-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Allow JSON payload for GET calls #2004
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
Comments
It's not something we'll be able to solve. We have already done everything that we could. You can follow the discussions and solution already merged: |
The HTTP GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
The HTTP specification says in section 4.3
|
@ycd The HTTP specification your using is from 1991. The updated one is RFC 7231 where it is allowed to include a body.
So generally it is allowed but discouraged. |
@ArcLightSlavik thanks, just read that publication ,actually you were right, in practice it's fine but in theory it's not a good idea i think.. π€ |
That's true for OpenAPI 3.0, but seems to be changed in 3.1 as this PR suggests. The same change was removed from 3.0 only because it did't fit the semantics of a patch release According to the PR, 3.1 will read as follows, which is in-line with RFC 7231.
|
@stevesuh the code piece works when you send a request with cURL
So basically FastAPI allows request body with They are also very strict about not supporting it. See: swagger-api/swagger-ui#2136 If you want you can open another issue in Swagger UI's repository but FastAPI can not do anything about this topic since your issue is completely about the Swagger UI. |
I consider the issue resolved then. |
Thanks for the help here everyone! π π Thanks for reporting back and closing the issue @stevesuh π
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First check
Example
Here's a self-contained minimal, reproducible, example with my use case:
The text was updated successfully, but these errors were encountered: