Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask multiple request body examples #248

Open
IlyaKalosha1 opened this issue Aug 3, 2022 · 1 comment
Open

Flask multiple request body examples #248

IlyaKalosha1 opened this issue Aug 3, 2022 · 1 comment

Comments

@IlyaKalosha1
Copy link

Hi,
is there a way to set multiple examples for body when using spectree with flask.
The example how it's done in FastAPI - https://fastapi.tiangolo.com/tutorial/schema-extra-example/#body-with-multiple-examples:~:text=%3A-,Body,examples,-%C2%B6

Thanks

@kemingy
Copy link
Member

kemingy commented Aug 4, 2022

Hi @IlyaKalosha1, thanks for asking. I checked the FastAPI examples details and OpenAPI spec. I found this is not supported yet.

Reason:

  • FastAPI added the examples to "requestBody"/"content"/"application/json"/examples (can support multiple examples) rather than the normal path "schemas"/"{SchemaName}"/example (only support one)

Need to change some code to support this.

  • support multiple examples for the request body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants