I tried the official workaround for re-using schemas with additionalProperties=false in draft 6.
In my case, the relevant part is:
{
"$schema": "http://json-schema.org/draft-06/schema",
...
"definitions": {
...
"Match": {
"type": "object",
"allOf": [
{"properties": {
"matchFunction": { "type": "string", "format": "uri" },
"attributeValue": {
"$ref": "common.schema.json#/definitions/AttributeValueType"
}
}},
{
"oneOf": [
{
"properties": {
"attributeDesignator": { "$ref": "#/definitions/AttributeDesignator"}
}
,
"required": [
"attributeDesignator"
]
},
{"properties": {
"attributeSelector": {
"$ref": "#/definitions/AttributeSelector"}
},
"required": [
"attributeSelector"
]
},
{
"properties": {
"variableRef": {
"$ref": "#/definitions/VariableReference"
}
},
"required": [
"variableRef"
]
}
]
}
],
"anyOf": [
{
"propertyNames": {"enum": ["matchFunction", "attributeValue"]}
},
{
"propertyNames": {"oneOf": [
{"enum": ["attributeDesignator"]}, {"enum": ["attributeSelector"]}, {"enum": ["variableRef"]}
]}
}
]
}
...
}
}
I get this error:
Caused by: org.everit.json.schema.SchemaException: #/definitions/Match: expected at most 1 of 'allOf', 'anyOf', 'oneOf', 2 found
Is this workaround supposed to work with the json-schema library ?
I tried the official workaround for re-using schemas with additionalProperties=false in draft 6.
In my case, the relevant part is:
{ "$schema": "http://json-schema.org/draft-06/schema", ... "definitions": { ... "Match": { "type": "object", "allOf": [ {"properties": { "matchFunction": { "type": "string", "format": "uri" }, "attributeValue": { "$ref": "common.schema.json#/definitions/AttributeValueType" } }}, { "oneOf": [ { "properties": { "attributeDesignator": { "$ref": "#/definitions/AttributeDesignator"} } , "required": [ "attributeDesignator" ] }, {"properties": { "attributeSelector": { "$ref": "#/definitions/AttributeSelector"} }, "required": [ "attributeSelector" ] }, { "properties": { "variableRef": { "$ref": "#/definitions/VariableReference" } }, "required": [ "variableRef" ] } ] } ], "anyOf": [ { "propertyNames": {"enum": ["matchFunction", "attributeValue"]} }, { "propertyNames": {"oneOf": [ {"enum": ["attributeDesignator"]}, {"enum": ["attributeSelector"]}, {"enum": ["variableRef"]} ]} } ] } ... } }I get this error:
Is this workaround supposed to work with the json-schema library ?