How can I provide a custom example value for the return value of routes? When the return is a Pydantic model, you can set the example keyword argument on a pydantic Field or add it to schema_extra in the Model config. However, when the return value is a simple type such as str or List[Optional[int]]` there seems to be no way to provide an example. Am I missing something, or is this a missing feature?
@phy25 I am asking about responses not request parameters.
you can manually extend/alter the returned schema, but I'd think there would be a way to do this
https://fastapi.tiangolo.com/advanced/extending-openapi/
Hi, @retnikt !
You can add examples for in field responses. See this page
Thanks @Slyfoxy
Thanks for the help here everyone! :clap: :bow:
Thanks for reporting back and closing the issue @retnikt :+1: