Files
pydantic/docs/examples/schema_with_example.py
T
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00

19 lines
336 B
Python

# output-json
from pydantic import BaseModel
class Person(BaseModel):
name: str
age: int
class Config:
schema_extra = {
'examples': [
{
'name': 'John Doe',
'age': 25,
}
]
}
print(Person.schema_json(indent=2))