Files
pydantic/docs/examples/schema1.json
T
Samuel Colvin dd8d013e10 Schemas (#190)
* starting field and model schemas

* field.schema()

* sub-models working

* move default in Schema and tests

* adding schema

* tweak docs
2018-06-28 13:06:24 +01:00

43 lines
858 B
JSON

{
"type": "object",
"title": "Main",
"properties": {
"foo_bar": {
"type": "object",
"title": "FooBar",
"properties": {
"count": {
"type": "int",
"title": "Count",
"required": true
},
"size": {
"type": "float",
"title": "Size",
"required": false
}
},
"required": true
},
"Gender": {
"type": "int",
"title": "Gender",
"required": false,
"choices": [
[1, "Male"],
[2, "Female"],
[3, "Other"],
[4, "I'd rather not say"]
]
},
"snap": {
"type": "int",
"title": "The Snap",
"required": false,
"default": 42,
"description": "this is the value of snap"
}
},
"description": "This is the description of the main model"
}