Open
Description
file schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"dataType": { "$ref": "#/$defs/datatypes-enum" }
},
"required": ["dataType"],
"$defs": {
"datatypes-enum": {
"oneOf": [
{
"type": "string",
"enum": ["bool", "boolA"]
},
{
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": { "$ref": "#/$defs/datatypes-enum" }
}
}
]
}
}
}
file data.json
{
"dataType": { "test": { "test": { "test": "bool" } } }
}
Expected results when validating data.json against schema.json: valid file (verified using https://www.jsonschemavalidator.net/ and jsonschema in python).
Results I get: "schema with # /$defs/datatypes-enum/oneOf/0 already inserted".
Any advice would be appreciated.