-
Notifications
You must be signed in to change notification settings - Fork 148
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
migrate from swagger-codegen to openapi-generator #93
Comments
Yes we should do this. If you have cycles for the PR that's awesome. Otherwise I'll try to get to it. |
There is a document for the migration: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/migration-from-swagger-codegen.md |
@mbohlool Thanks for your advice. I'll check these clients and update docs too. Some changes in generated code will appear because clients are based on very old version of generator - java client: Line 52 in d0821e6
python: Line 49 in d0821e6
I hope we'll get working clients with a small set of non-breaking changes. |
I tried the Java generator. It seems to fail on the @tomplus, I will own this for Java and Typescript. Thanks! |
@brendandburns Thanks 👍 I'm working on the Python client. |
UPDATE: I did some tests and figure out why the type-mapping behaves differently: To start with, I think openapi-generator is doing the right thing (we've improved the logic to resolve aliases to primitive type). Here is the definition of
which is not a model but a string (primitive type) with a special format (int-or-string) so the following model (as an example) is resolving the property type as string correctly:
To make the k8s spec works with type-mapping in openapi-generator, here is a way to do it:
(another way is to convert the JSON file into YAML and comment out the above (alias) definition. |
I started working on the Ruby client. 💨 |
memo: the haskell client has been switched. #108 |
UPDATE: the Ruby client generator has been switched to openapi-generator. #103 |
@tomplus any update on the Python client? I'm waiting on swagger-api/swagger-codegen#8061 to get kubernetes-client/python#411 resolved. It seems you made some progress on that, I haven't had a chance to update and test my broken code to see if the workaround fixes the hang. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
@brendandburns Wow! Great news. I did some checks and it looks like csharp client still uses the old generator. Javascript client also but it likely doesn't use this repo to generate (I suggest to remove its script to avoid confusion). Python-asyncio needs some cleanups, one unused variant uses swagger - I'll remove it. Should we remove swagger-codegen directories and files when all generators has been switched or maybe you want to leave it for a while? |
csharp uses autorest, which is a totally different generator. Javascript can be removed as we're using typescript. I'll send PRs to do the cleanup. |
…enapi-generator. * related * kubernetes-client/gen#93 * swagger-api/swagger-codegen#8061 * OpenAPITools/openapi-generator#1387 * Drop hack for empty reponses Bump versions: * sdks to 1.0.79 * core to 1.0.74
This repo uses the swagger-codegen, which is not actively maintained, at least from a my point of view. It makes lots of hacks like post-generation patching and it’s very hard to maintain these scripts.
For instance - here is a list of PRs which are ready to merge but are not merged yet and had to be applied as patches in Python generator:
A lot of contributors moved from the swagger-codegen to the new project - openapi-generator. Basically it’s a fork of swagger-codegen but it’s actively developed and it gains popularity very fast.
All above PRs are already ported and merged to the openapi-generator:
async
toasync_req
OpenAPITools/openapi-generator#519 (merged)What do you think about changing generator? Is it possible? I’ll be happy to work on it...
The text was updated successfully, but these errors were encountered: