You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While iterating on my plugin, I ended up deleting a field that was still referenced in the 'required' section:
"virtualSourceDefinition": {
"type": "object",
"additionalProperties" : false,
"required": [ "mountLocation" ],
"properties" : {
"name": {
"type": "string",
"prettyName": "Container Name",
"description": "Name to use for container, defaults to random name"
}
}
},
This later caused a confusing UI error by stating that the field was required even though it didn't show up in the UI. This should be caught as part of build phase validation.
Schema validation uses the schema definitions to validate the given json data instance. In this case, if required fields are not present, they are detected and reported. However, using metaschema file (from json-schema.org) as the schema file and plugin schema json as the instance to validate (and make sure its a valid json), required fields validation cannot be achieved. Reason - metaschema defines "required" to be a string array and validation does ensure it is a string array if that property is defined in plugin schema file. However, validator code in jsonschema package does not look at the "instance" which is the plugin schema object and enforce/validate that all required fields are present in the "properties". Unless we write custom schema walker to do this, most or all the scheme validation tools did not detect this scenario where a property in required fields is not defined at all. This is a link that discusses a similar issue - json-schema-org/json-schema-spec#659
While iterating on my plugin, I ended up deleting a field that was still referenced in the 'required' section:
"virtualSourceDefinition": {
"type": "object",
"additionalProperties" : false,
"required": [ "mountLocation" ],
"properties" : {
"name": {
"type": "string",
"prettyName": "Container Name",
"description": "Name to use for container, defaults to random name"
}
}
},
This later caused a confusing UI error by stating that the field was required even though it didn't show up in the UI. This should be caught as part of build phase validation.
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: