mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
e7227db41a
* starting insert prints * working exec_script * remove prints, fix exec_examples.py * more cleanup of examples, better model printing * upgrade netlify runtime * extra docs deps * few more small tweaks
18 lines
322 B
Python
18 lines
322 B
Python
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))
|