OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.49k stars 6.51k forks source link

`in: cookie` not properly handled by dart2 templates? #7344

Open tek08 opened 4 years ago

tek08 commented 4 years ago

https://github.com/OpenAPITools/openapi-generator/blob/ee0686e13f58f1c7029f76bef5c87d547b68f7d5/modules/openapi-generator/src/main/resources/dart2/api_client.mustache#L34

Cookie authentication, I think (correct me if I'm wrong, please, as I'm still learning swagger/generator), is not handled correctly in dart2 templates. Rather than putting Cookie headers in requests back to server, the apiKey gets sent back as a query parameter.

wing328 commented 4 years ago

https://github.com/OpenAPITools/openapi-generator/blob/ee0686e13f58f1c7029f76bef5c87d547b68f7d5/modules/openapi-generator/src/main/resources/dart2/api_client.mustache#L22-L40 is the code block related to authentication and you're right that it doesn't support cookie authentication at the moment.

May I know if you've time to contribute the enhancement using {{#isKeyInCookie}} ... {{/isKeyInCookie}} ?

tek08 commented 4 years ago

Happy to give it a try. Draft PR is at #7346 . Working on building and updating samples locally, then will check off the rest of the checklist and remove draft status.