Skip to content
Discussion options

You must be logged in to vote

I think this is not possible.

The Body_read_items_items_get that you see in openapi is the schema of whole request body of the endpoint.
Following the way you described, if we use this type in several endpoints, the request body schema should be named the same way (TestDep?).
But what if second endpoint includes other Form parameters along with this dependency? All these parameters should be included into the request body schema.

This is why FastAPI creates different request body schemas for every endpoint and uses the endpoint function name and http-method to construct the name of this schema.

You can modify the way those name are being created using generate_unique_id_function parameter:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants