Category
Describe the bug
This is a duplicate issue of #5361.
Some Site Script examples in the latest documentation for Site design JSON schema fail to validate against the latest Site Script Schema.
Certain Site Script examples do validate (with some modifications to the JSON site script as noted in "N.B." below). I can provide examples of those if needed.
I might have tracked the issue to the way the "additionalProperties" property is specified in several action definitions, but I need confirmation in case the validation error lies elsewhere.
Steps to reproduce
- Use the example JSON in the Define a new content type section of the documentation to form a site script. For reference, the following is a site script constructed in this way:
{ "$schema": "schema.json", "actions": [ { "verb": "createContentType", "name": "Contoso Projects", "description": "custom list content type", "parentName": "Item", "hidden": false, "subactions": [ { "verb": "addSiteColumn", "internalName": "siteColumn1Text" }, { "verb": "addSiteColumn", "internalName": "siteColumn2Number" }, { "verb": "addSiteColumn", "internalName": "siteColumn3Note" } ] } ] }
N.B. While the documentation specifies it, I have removed the following properties from this Site Script: "bindingdata" and "version". When these properties are included, the Site Script JSON will always fail to validate against the latest Site Script Schema, because there is an "additionalProperties" property that prohibits them—please refer to the Site Script Schema for confirmation. In the previous (draft-06) Site Script Schema, those properties were defined and allowed.
-
Use a JSON Schema validator to validate the JSON above against the latest Site Script Schema. E.g. I have used JSON Schema Validator as well as Ajv to confirm the invalidity.
-
See validation error.
Expected behavior
JSON Site Script example should be valid against latest Site Script Schema.
Additional context
The main validation issue seems to be that the Site Script action has properties the schema does not allow. However, the errors seem to suggest that none of the properties are allowed by the Site Script Schema, even the required ones for this example (e.g. verb, name, hidden).
This suggests that the error is in how the "additionalProperties" property is set in the Site Script Schema for the action. I can provide additional information on this if needed.