Metaobjects - Dashboard ( JSON / validations )

Hello,

I have some questions to community maybe someone meet those and already make some patterns for it.

First one is about JSON validation any one knows how it works ? In my feelings it doesnt respect any type of JSON validations.

Second is about making validations / some patterns for list referances. What if i want to do list with limited entries? Did someone have some ideas how to resolve that?

Have a nice day ! :slightly_smiling_face:

Bumping.

Per the allowed validations: https://shopify.dev/docs/api/admin-graphql/unstable/queries/metafieldDefinitionTypes#examples-Fetch_all_metafield_definition_types

You can have a max or minimum on a any list. type. Although it must be added through the API. For example list.metaobjects:

{
    "name": "test2",
    "key": "test_2",
    "type": "list.metaobject_reference",
    "validations": [
        {
            "name": "list.max",
            "value": "2"
        }
    ]
} 

For the JSON validations see: https://www.liquid-technologies.com/online-json-schema-validator

And: https://json-schema.org/learn/miscellaneous-examples.html

1 Like