Enhancement: Support custom keys on data #488

Closed
opened 2026-10-05 02:49:49 +02:00 by adam · 2 comments
Owner

Is your feature request related to a problem? Please describe.

I have some data structures I seen unable to re-create from within the data management panel. The main issue seems to be around having keys on my objects. For example, take this languages.json file:

{
    "en": {
        "dir": "ltr",
        "label": "English",
        "shorthand": "GB",
        "locale": "en-gb"
    },
    "sv": {
        "dir": "ltr",
        "label": "Svenska",
        "shorthand": "SE",
        "locale": "sv-se"
    }
}

I am unable to create a UI for adding and managing new languages, because it seems I am unable to define the key for each object.

Describe the solution you'd like

The ability to define one of the sub-object entries, to become a key for the data. For example with the data above, I would define the key as shorthand.

Describe alternatives you've considered

I am considering finding a way to break the data into separate files or arrange the data in another way. I don't have a plan yet.

Additional context

I have other data types that follow a similar pattern though which I would also like to make editable. For example, these translations:

    en: {
        meta: {
            title: '',
            rssTitle: 'RSS Feed',
            jsonTitle: 'JSON Feed',
            description: 'EN',
            opengraphDefaultAlt: 'An English description of the default opengraph image'
        },
        header: {
            skipLink: 'Skip to content'
        }
    },
    sv: {
        meta: {
            title: '',
            rssTitle: 'RSS Feed',
            jsonTitle: 'JSON Feed',
            description: 'SV',
            opengraphDefaultAlt: 'A Swedish description of the default opengraph image'
        },
        header: {
            skipLink: 'Hoppa till innehållet'
        }
    },
**Is your feature request related to a problem? Please describe.** I have some data structures I seen unable to re-create from within the data management panel. The main issue seems to be around having keys on my objects. For example, take this `languages.json` file: ``` { "en": { "dir": "ltr", "label": "English", "shorthand": "GB", "locale": "en-gb" }, "sv": { "dir": "ltr", "label": "Svenska", "shorthand": "SE", "locale": "sv-se" } } ``` I am unable to create a UI for adding and managing new languages, because it seems I am unable to define the `key` for each object. **Describe the solution you'd like** The ability to define one of the sub-object entries, to become a key for the data. For example with the data above, I would define the `key` as `shorthand`. **Describe alternatives you've considered** I am considering finding a way to break the data into separate files or arrange the data in another way. I don't have a plan yet. **Additional context** I have other data types that follow a similar pattern though which I would also like to make editable. For example, these translations: ``` en: { meta: { title: '', rssTitle: 'RSS Feed', jsonTitle: 'JSON Feed', description: 'EN', opengraphDefaultAlt: 'An English description of the default opengraph image' }, header: { skipLink: 'Skip to content' } }, sv: { meta: { title: '', rssTitle: 'RSS Feed', jsonTitle: 'JSON Feed', description: 'SV', opengraphDefaultAlt: 'A Swedish description of the default opengraph image' }, header: { skipLink: 'Hoppa till innehållet' } }, ``` <!-- github-sync-id:1845336950 -->
adam closed this issue 2026-10-05 02:49:49 +02:00
Author
Owner

Hi @scottsweb, that is correct; the library we use (uniforms) expects the JSON schema for rendering the form. In your case, the locale key is dynamic; it is not supported.

JSON Schema has the patternProperties option, which would not allow the tool to render the input for a dynamic key.

Hi @scottsweb, that is correct; the library we use (uniforms) expects the JSON schema for rendering the form. In your case, the locale key is dynamic; it is not supported. JSON Schema has the `patternProperties` option, which would not allow the tool to render the input for a dynamic key. <!-- github-comment-id:1674639754 -->
Author
Owner

Thanks for confirming @estruyf — I think this issue can be closed for now as its out of scope. I might be able to adjust my settings too and find a path forward.

Thanks for confirming @estruyf — I think this issue can be closed for now as its out of scope. I might be able to adjust my settings too and find a path forward. <!-- github-comment-id:1682856925 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#488