I have the following json schema definition in my .raml file
- request: |
{
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "http://jsonschema.net",
"required": true,
"properties": {
"personProperty": {
"type": "array",
"items": {
"$ref": "property"
}
}
}
}
- property: |
{ "$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"description": "A single person property",
"properties": {
"fieldId": { "type": "integer", "required": true},
"systemId": { "type": "integer", "required": false},
"value": { "type": "string" , "required": true },
"created": { "type": "string" , "required": false }
}
}
I need mule ESB to reject the input when one of the required fields inside the array is missing.
For example this should be rejected with 400- BAD REQUEST:
{
"personProperty": [
{
"fieldId": "1",
"systemId": 1,
"created": "2015-02-23 21:19:00.907"
}
]
}
If the schema is not inside an array, the validation works properly. But when inside the array, it is not validating any single item having the required attribute.
Do I need a special configuration?
Thanks.