-
-
Notifications
You must be signed in to change notification settings - Fork 365
Closed
Description
I have a NON required property object "client".
"client" however has required properties if present.
"client" properties should be checked ONLY if "client" is present.
The validator does the check no matter what. So the validation fails when "client" property is not present.
I tested the below data/schema with the Java validator and it works (see: http://json-schema-validator.herokuapp.com/), however with this PHP validator it fails.
Data
{
"command": "StartJob",
"data": {
"input_type": "VIDEO",
"outputs":
[
{
"output_type": "VIDEO"
}
]
}
}Schema:
{
"id": "http://test.com/input-schema/ValidateInputAsset#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Schema for activity task",
"type": "object",
"properties": {
"client": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"externalId": {
"type": "string"
},
"role": {
"type": "string"
}
},
"required": ["name", "role"],
"additionalProperties": true
},
"command": {
"type": "string"
},
"data" : {
"type": "object"
}
},
"required": ["command", "data"],
"additionalProperties": true
}Metadata
Metadata
Assignees
Labels
No labels