Metaobjects - Dashboard ( JSON / validations )

Solved

Metaobjects - Dashboard ( JSON / validations )

Aleksandero-
Shopify Partner
2 0 0

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 ! 🙂

Accepted Solution (1)

skelouse
Shopify Partner
1 1 1

This is an accepted solution.

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

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

View solution in original post

Replies 2 (2)

Aleksandero-
Shopify Partner
2 0 0

Bumping.

skelouse
Shopify Partner
1 1 1

This is an accepted solution.

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

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