In pydantic we can add an example to Fields, such as:
Field(default=None, example="A very nice Item")
Which will then be displayed in the swagger API docs:
How do we do this in sqlmodel? Adding the key example to the Field class in sqlmodel returns error:
Field() got an unexpected keyword argument 'example'
Thank you!
Can be accomplished using schema_extra
:
Field(default=None, schema_extra={'example': "A very nice Item"})
Can be found in code: