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
Cookie transport must return empty json and not null
in response.data
on login
#1037
Cookie transport must return empty json and not null
in response.data
on login
#1037
Conversation
I understand the issue here. I was wondering: will the OpenAPI generator be happy if we properly define a 204 response with no content? Sounds like the most correct way to define this response to me. |
Right! That is aesthetically more pleasing. However, it didn't work back in January 31st this year for this guy. He came up wirh some hacky middleware solution. We would have to test, and see. I do think 204 makes the most sense, but it will be irritating if the I'll do some more digging and testing today. And post my results here. Just fyi, everything ran fine when it was empty json |
Hmm I guess it's still around: OpenAPITools/openapi-generator#7720 Those 204 responses definitely cause lot of issues 😅 If you have the chance to try, and confirm it's not working, it could be nice. Otherwise, let's go for the empty JSON. The unit test will need to be updated. Another thing: could you revert the version bumping? This is something I do automatically with a script when I create a release. |
…onse with status code 204 when body is empty. The database backend login response is a cookie header with empty body. This causes issues when integrating the openapi schema into openapi-generator. Because the code generator expects the response to be a JSON when the status code isn't 204.
4c1daa8
to
bbe39c8
Compare
I am done testing, and everything ran fine with We should require Fastapi 0.79, coincidentally the latest version 😅, as this is when the 204 issue was fixed on the Ready to merge! |
Codecov Report
@@ Coverage Diff @@
## master #1037 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 20 35 +15
Lines 717 957 +240
==========================================
+ Hits 717 957 +240
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Great! I consider we are doing the right thing here, so let's go with it and we'll see if some OpenAPI generators cause issues to some people. I took the liberty to slightly change your approach by building a full response manually. This way, we still be compatible with older FastAPI. Thank you for your raising this point and your help 👍 |
@all-contributors add @caniko for bug |
I've put up a pull request to add @caniko! 🎉 |
Thank you for this awesome package! @frankie567 you reverted the versioning on |
Thanks! No, I did it on purpose: since we build a custom raw |
I see, I misunderstood this statement! Have a good weekend 😁 |
This causes issues when integrating the openapi schema into openapi-generator. Because the code generator expects the response to be a JSON, as it should be.