mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
bdc3973d90
* fixes for Windows development * Allow Config.schema_extra to be a callable
16 lines
366 B
Python
16 lines
366 B
Python
# output-json
|
|
from typing import Dict, Any
|
|
from pydantic import BaseModel
|
|
|
|
class Person(BaseModel):
|
|
name: str
|
|
age: int
|
|
|
|
class Config:
|
|
@staticmethod
|
|
def schema_extra(schema: Dict[str, Any]) -> None:
|
|
for prop in schema.get('properties', {}).values():
|
|
prop.pop('title', None)
|
|
|
|
print(Person.schema_json(indent=2))
|