Для следующей части схемы JSON:
Код: Выделить всё
{
"if": {
"anyOf": [
{
"allOf": [
{
"not": {
"required": [
"flight_condition"
],
"properties": {
"flight_condition": {
"items": {
"required": [
"value"
]
}
}
}
}
},
{
"required": [
"supplier_is_exempt"
],
"properties": {
"supplier_is_exempt": {
"contains": {
"required": [
"value"
],
"properties": {
"value": {
"enum": [
false
]
}
}
}
}
}
}
]
},
{
"allOf": [
{
"not": {
"required": [
"city"
],
"properties": {
"city": {
"items": {
"required": [
"value"
]
}
}
}
}
},
{
"not": {
"required": [
"declare_value"
],
"properties": {
"declare_value": {
"items": {
"required": [
"value"
]
}
}
}
}
}
]
}
]
},
"then": {
"required": [
"product_ID"
]
}
}
Код: Выделить всё
if (property flight_condition is required or property supplier_is_exempt is not provided) then property product_ID is required.
Подробнее здесь: https://stackoverflow.com/questions/793 ... ema-in-php
Мобильная версия