Open dkliban opened 4 years ago
@wing328 @cliffano @zlx @autopp: Should I make a PR for the proposed solution or do you have a better solution in mind?
@dkliban Thanks for report.
However, that is probably not exactly right because it gives the wrong impression to the user that cookie auth is supported, when in reality it is not.
I agree with you.
Offcourse, the best solution is supporting cookie auth. But for the time being, I think it's okay to generate an error in RubyClientCodegen
if cookie-auth was included.
@OpenAPITools/generator-core-team Is there a precedent where the Codegen class will generate an error depending on the contents of the spec?
My suggested fix doesn't work. It produces a client that runs, but then it fails at run time. We ended up removing cookie auth from the OpenAPI schema before generating the Ruby client.
@OpenAPITools/generator-core-team Is there a precedent where the Codegen class will generate an error depending on the contents of the spec?
We seldom do that. Sometimes we throw warnings to inform the users that certain things in the spec are not yet supported.
@dkliban Your suggested fix looks like a good start. Mind sharing more about the run time failure?
@wing328 The traceback can be seen here: https://github.com/pulp/pulpcore/pull/785#discussion_r455976578
For anyone looking, this is an issue in the 5.1.x branch as well.
Still an issue :D
@aeneasr may I know if you've time to contribute a fix or would like to sponsor the work?
Hey, sorry for the last +1 comment here. Absolutely, we'll try to get it sorted. I think the OP also included a potential patch. Unfortunately I never wrote Ruby before but I'll manage :)
Description
When cookie support for header auth is present in the OpenAPI schema v3, the Ruby client produced contains nothing after the : on the following line:
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache#L173
On the other hand the Python client is generated correctly.
My understanding is that cookie header auth is not supported by the Ruby client, but the client should still compile.
openapi-generator version
4.3.1
Suggest a fix
In our current workflow we replace line 173 from the template with https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/python/configuration.mustache#L488
However, that is probably not exactly right because it gives the wrong impression to the user that cookie auth is supported, when in reality it is not.