Created
September 3, 2021 20:10
-
-
Save amaralrfl/aa4ecc4ce56d995dfa243d4b67cab509 to your computer and use it in GitHub Desktop.
JSON Schema reduzido da lista de produtos do ServeRest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"required": [ | |
"quantidade", | |
"produtos" | |
], | |
"properties": { | |
"quantidade": { | |
"type": "integer", | |
"default": 0 | |
}, | |
"produtos": { | |
"type": "array", | |
"additionalItems": true, | |
"items": { | |
"anyOf": [ | |
{ | |
"type": "object", | |
"required": [ | |
"nome", | |
"descricao", | |
"preco", | |
"quantidade", | |
"_id" | |
], | |
"properties": { | |
"nome": { | |
"type": "string" | |
}, | |
"descricao": { | |
"type": "string" | |
}, | |
"preco": { | |
"type": "integer" | |
}, | |
"quantidade": { | |
"type": "integer", | |
"default": 0 | |
}, | |
"_id": { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": true | |
} | |
] | |
} | |
} | |
}, | |
"additionalProperties": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment