Skip to content

Better handling of YAML data in fields #1251

Description

@philayres

Requirement 1

The curly substitutions already offer a method to parse JSON, using the form:

{{<string_is_json_hash>.json_parse.<key_name>}}

Provide the equivalent for YAML

{{<string_is_yaml_hash_or_array>.yaml_parse.<key_name>}}

Requirement 2

We need to understand how Dynamic::FieldEditAs::ColTypeJson is used. It appears to allow a user to edit a free text field in YAML format, storing the result into a JSON or JSONB database field. There is an alignment with views/common_templates/edit_fields/_column_type_json.erb. This needs to be confirmed and documented.

Requirement 3

Provide an edit field and result field implementation to specify name_starts_with_yaml_object to allow editing using the YAML codemirror config (see the JSON edit fields) while providing a read view as an object (reusing app/views/common_templates/_common_template_result_fields.html.erb for the section {{else is this_value 'typeof' 'object'}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions