-
Notifications
You must be signed in to change notification settings - Fork 1k
Example Site Scripts Invalid Against Latest Site Script Schema #5361
Copy link
Copy link
Closed
Labels
area:docsCategory: SharePoint developer/development documentation relatedCategory: SharePoint developer/development documentation relatedarea:site-designCategory: Site Designs/Site ScriptsCategory: Site Designs/Site Scriptsstatus:to-be-reviewedIssue needs to be reviewed by Microsoft for additional follow up / review.Issue needs to be reviewed by Microsoft for additional follow up / review.type:archive-old-issueIssues which are closed as tool old for active workIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Metadata
Metadata
Assignees
Labels
area:docsCategory: SharePoint developer/development documentation relatedCategory: SharePoint developer/development documentation relatedarea:site-designCategory: Site Designs/Site ScriptsCategory: Site Designs/Site Scriptsstatus:to-be-reviewedIssue needs to be reviewed by Microsoft for additional follow up / review.Issue needs to be reviewed by Microsoft for additional follow up / review.type:archive-old-issueIssues which are closed as tool old for active workIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Category
Describe the bug
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
{ "$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.