-
Notifications
You must be signed in to change notification settings - Fork 59
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
Notes on the generator #28
Comments
I'm not an ongoing user yet but I would like to be. My main impediment at the moment being getting this onto hackage. On that basis and given the discussion in #27 I would be in favour of option two. My main reason being that I think we'll probably need to massage the output of the generator a bit to achieve the package organisation discussed in that PR. |
I'm a potentially interested user as well, but I'm hesitant to pick up the library until some of this stuff has stabilized. Is there anything I could do to help either this process or the one outlined in #27 to get it on Hackage? |
I've tried generating the client code with the OpenAPI generators and have run into the errors below. No idea what the root cause might be, unfortunately, although I've seen some issues with similar errors (e.g. OpenAPITools/openapi-generator#2236). Log Snippet
|
@jkachmar Do you have a link to the spec file used that this failed on & have a link to it? I noticed the linked issue above was using |
I tested it with |
I was able to compile the "processed" It did output a fair amount of warnings, but they did not seem to impact the generated code & the stack build cmd completed fine: I did not seem to encounter the same error in your log? |
I tested out making the changes to after running The codegen is pretty much the same, save for the ordering of the "body" parameters. On the other hand, it looks like they are now finally accepting some commits in 1) swagger-codegen swagger-api/swagger-codegen@ab14608 to udpate to stack lts-13.8. So it looks like some ability to update code there is possible, but I'm also not sure when they will be switching over to the 3.0.0 branch (master is on 2.4.1), and if/when they do switch over the |
Personally, I feel that since the Kubernetes clients for Ruby and Python clients here are switching over to the openapitools generators I feel like it makes sense to want to switch this one as well. It also means that when/if the Kubernetes OpenAPI spec starts to use some features from OpenAPI v3 it would be easier to send a PR up to you that incorporates that functionality into the |
@jonschoning Awesome! Can you open a PR against the gen repo? |
sure, will do |
This can probably be closed since the above PR has been merged. |
Several months ago, the folks at SmartBear (who own the repo for swagger-codegen [1] ) decided to do a re-write while moving from supporting the 2.0 openapi spec to 3.0.
However, in this process, they also changed the templating language from mustache to handlebars - invalidating existing languages - essentially existing work for each language would have to be re-built from scratch.
This caused a split in which the primary open-source contributors left, and forked swagger-codegen into a new repo "openapi-generator" [1] - which focuses on an incremental path to support of the openapi 3.0 spec, and not moving to handlebars templates or throwing out existing work on generators, and focusing more on backwards-compatibility.
I've included the haskell-http-client generator in the new
openapi-generator
, which has been merging my pull requests promptly, and in which i also have commit rights.I've tried submitting PR's to swagger-codegen, but they have not been merging any PR's lately.
the upshot:
Continue to use swagger-codegen. For now, the breaking changes are only on the 3.0.0 branch and master still includes the old haskell-http-client. If they switch master to 3.0.0 at some point haskell-http-client probably won't be available there anymore. You could continue to target an existing commit for the generator, but probably not be able to get any changes made to the haskell-http-client generator very easily. So, If the current version of the generator is serving your needs adequately, then all is good.
Switch to openapi-generator. It's pretty much backwards compatible, but some cli arguments may be depricated. Also i'm not sure if the build process here supports targeting a different repo than swagger-codegen. If more features/changes in the generator are desired though, it would be much easier to make them in openapi-generator.
As of today, I haven't made extensive changes to the haskell-http-client generator, so there is not much difference in features from swagger-codegen vs. openapi-generator.
Question: Are there any ongoing/steady users of kubernetes-client/haskell ?
[1] https://github.com/swagger-api/swagger-codegen
[2] https://github.com/OpenAPITools/openapi-generator
The text was updated successfully, but these errors were encountered: