This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
null values are discarded from OpenAPI examples #5559
Labels
You can continue the conversation there. Go to discussion →
First Check
Commit to Help
Example Code
Taken from https://fastapi.tiangolo.com/advanced/additional-responses/
Description
example
orexamples
)None
The code above outputs:
As you can see, the
absent
example is absent.Operating System
Linux
Operating System Details
No response
FastAPI Version
0.73.0
Python Version
3.8.9
Additional Context
openapi.utils.get_openapi
has this line:exclude_none
could cause the issue.When setting it to True, OpenAPI generation fails with the following error:
The text was updated successfully, but these errors were encountered: