Closed DeanRae closed 3 years ago
@DeanRae Sorry for the long delay.
strong
mode by default, which imposes extra checks on the schema.v1.0.0-rc.4
(a7a5b557c6e0393bf3a2aeeddd129f1332d5db1d).additionalProperties
and required
are specified:{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"person": {
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "pattern": "^[\\s\\S]*$" },
"children": {
"type": "array",
"items": { "$ref": "#/definitions/person" },
"default": []
}
}
}
},
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"person": { "$ref": "#/definitions/person" }
}
}
Also note that \
should be escaped in strings, so in order to write down ^[\s\S]*$
into a js/json string, "^[\\s\\S]*$"
should be used.
I'm going to close this as a7a5b55 (included in v1.0.0-rc.4
) fixed the issue reported here, and the rest are non-issues.
Please feel free to comment if there are more concerns.
I'm new to JSON schema validation and am trying to use recursion for an array item type like the example below.
e.g.
I have tried for days to fix this error but I keep on getting: [requireValidation] type should be specified at #/properties/children/items
Any advice on how to fix this please?
edit: I forgot to mention that I was using the parser api