У меня есть следующее определение схемы json в моем файле .raml
- 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 }
}
}
Мне нужен mule ESB, чтобы отклонить ввод, когда одно из обязательных полей внутри массива отсутствует.
Например, это должно быть отклонено с помощью 400-ПЛОХОГО ЗАПРОСА:
{
"personProperty": [
{
"fieldId": "1",
"systemId": 1,
"created": "2015-02-23 21:19:00.907"
}
]
}
Если схема не находится внутри массива, проверка работает правильно. Но находясь внутри массива, он не проверяет ни один элемент, имеющий обязательный атрибут.
Нужна ли мне особая конфигурация?
Спасибо.