Closed thewatts closed 8 years ago
If one of the contribs could give me a quick rundown of how validations happen with the project, I don't mind rolling up my sleeve and debugging / bug fixing / feature adding.
I'm a bit confused by what you're doing in your schema, did you mean allOf
instead of typeOf
? (So far as I'm aware, typeOf
isn't a recognised property in json schema)
@iainbeeston -- Hmm... I must have misread something somewhere about stating that an item is either one thing or the other.
Would the correct alternative be to use oneOf
instead?
{
"type": "object",
"required": [
"event"
],
"properties": {
"event": {
"oneOf": [
{"type": "null"},
{"$ref": "event-simple.json"}
]
}
}
}
But isn't that the same as saying that event is not required? Could you just remove the required property and define the event property as
"event": { "$ref": "event-simple.json" }
If you need any help with json schema I recommend Understanding JSON Schema
I'm going to close this for now. If you need any questions about the json schema format itself I recommend checking the json schema Google group
Thanks, @iainbeeston! I think part of the problem is that I had been validating with strict mode enabled.
Payload:
Example Schema:
The reference
event-simple.json
isn't validated against with the json payload. (( using strict mode ))