Pets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{ | { | ||
"type": "object", | |||
"title": "Pets", | |||
"properties": { | |||
"has_pet": { | |||
"title": "Has Pet", | |||
"description": "Do you have a pet?", | |||
"oneOf": [ | |||
{ | |||
"title": "Yes", | |||
"const": "yes" | |||
}, | |||
{ | |||
"title": "No", | |||
"const": "no" | |||
} | |||
], | |||
"type": "string" | |||
}, | |||
"pet_name": { | |||
"title": "Pet's name", | |||
"description": "What's your pet's name?", | |||
"type": "string" | |||
}, | |||
"pet_age": { | |||
"title": "Pet's age", | |||
"description": "What's your pet's age", | |||
"type": "number" | |||
}, | |||
"dietary_needs": { | |||
"title": "Dietary needs", | |||
"description": "What are your pet's dietary needs?", | |||
"type": "string" | |||
} | |||
}, | |||
"required": [ | |||
"has_pet" | |||
], | |||
"allOf": [ | |||
{ | |||
"if": { | |||
"properties": { | |||
"has_pet": { | |||
"const": "yes" | |||
} | |||
}, | |||
"required": [ | |||
"has_pet" | |||
] | |||
}, | |||
"then": { | |||
"required": [ | |||
"pet_age", | |||
"pet_name" | |||
] | |||
}, | |||
"else": { | |||
"properties": { | |||
"pet_age": false, | |||
"pet_name": false | |||
} | |||
} | |||
}, | |||
{ | |||
"if": { | |||
"properties": { | |||
"has_pet": { | |||
"const": "yes" | |||
}, | |||
"pet_age": { | |||
"minimum": 5 | |||
} | |||
}, | |||
"required": [ | |||
"pet_age" | |||
] | |||
}, | |||
"then": { | |||
"required": [ | |||
"dietary_needs" | |||
] | |||
}, | |||
"else": { | |||
"properties": { | |||
"dietary_needs": false | |||
} | |||
} | |||
} | |||
] | |||
} | } | ||
Latest revision as of 12:49, 6 May 2026
| type | "object" | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | "Pets" | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| properties |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| required |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| allOf |
|