hubspot-cms-vscode icon indicating copy to clipboard operation
hubspot-cms-vscode copied to clipboard

Support for different JSON files

Open anthmatic opened this issue 5 years ago • 1 comments
trafficstars

We can use https://code.visualstudio.com/api/references/contribution-points#contributes.jsonValidation to help devs make sure their JSON files contain any needed properties / types.

Another reference for this issue: https://ajv.js.org/guide/managing-schemas.html#re-using-validation-functions

anthmatic avatar Sep 15 '20 11:09 anthmatic

Would love to have this for fields.json, esp. since the docs don't seem to cover every field. The example given here has "default" in the list of fields used in all fields, but it's not listed in the type below it.

I've been using a basic workaround by having a JSON schema file on my computer and referencing it in vscode settings like

    "json.schemas": [
        {
            "fileMatch": [
                "**/*.module/fields.json"
            ],
            "url": "./module-schema.json"
        }
    ]

erik4github avatar Sep 17 '21 20:09 erik4github