The new Python client should be easier to use and more pythonic.
Please give it a try to see if you like it.
HN user
Core team and founding member of OpenAPI Generator, which is a free, open-source project to automatically generate API clients, server stubs, schemas, API documentation and more based on OpenAPI/Swagger specifications: https://github.com/OpenAPITools/openapi-generator
The new Python client should be easier to use and more pythonic.
Please give it a try to see if you like it.
One way is to auto-generate SDKs using OpenAPI Generator (http://github.com/openapitools/openapi-generator) given an OpenAPI spec.
If you want to generate a Crystal SDK for REST APIs, please give OpenAPI Generator [1] a try. Here are 3 simple steps to do so: https://forum.crystal-lang.org/t/crystal-api-client-generato....
Hopefully this will save you some time in manually creating the API clients in Crystal.
I agree with you that some generators are less mature. For example, we just added a Crystal client generator several weeks ago and we only have tests for posting a JSON body and getting it back to verify the result. Features like oneOf, anyOf are not yet supported (of course we welcome contributions to improve the Crystal client generator).
You can use customized templates (e.g. via -t option in the CLI) to meet your unique requirements. Another tips is to use code formatter such as https://prettier.io/, eslint etc to format the auto-generated code based on the style you want.
Please open an issue via http://github.com/OpenAPITools/openapi-generator/issues/new if you need help with OpenAPI Generator.
Disclosure: I'm the top contributor to OpenAPI Generator
You may want to give https://apitools.dev/swagger-parser/online/ a try to validate OpenAPI (fka Swagger) files.
You can do it online without a sign up or use the API or CLI according to your preference.
FYI. OpenAPI Generator supports many programming languages and server-side frameworks: https://github.com/OpenAPITools/openapi-generator#overview
This is not to say it has more languages supported than Protobuf as I do not know exactly how many generators out there supporting Protobuf.
(OpenAPI Generator also comes with the generator/converter that converts OpenAPI spec documents into gRPC and protocol buffer schema files. Not sure if OpenAPI Generator is also counted as a generator for Protobuf)
Does OpenAPI generate code for you? I have worked on projects that use it and didn't have any generated code, so I am assuming not...
Please give OpenAPI Generator [1] a try to generate clients, servers stubs, documentation, schemas (graphql, protobuf, etc) and more. It supports many programming languages and many companies are already using it [2]:
[1] https://github.com/OpenAPITools/openapi-generator
[2] https://openapi-generator.tech/users
(Disclosure: I'm the top contributor to OpenAPI Generator)
If you want to access RESTful APIs via OCaml, you may consider using OpenAPI Generator to generate the OCaml client automatically instead of manually creating one. Here are 3 simple steps to do so:
1. Download the OpenAPI Generator CLI Java JAR (https://repo1.maven.org/maven2/org/openapitools/openapi-gene...)
2. Rename the JAR as "openapi-generator-cli.jar"
3. Run the following command to generate an OCaml API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-gener...):
Mac/Linux:
$ java -jar openapi-generator-cli.jar generate -g ocaml -i https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o /var/tmp/ocaml/
Windows:
$ java -jar openapi-generator-cli.jar generate -g ocaml -i https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o C:\tmp\ocaml
If you've any feedback or question, please let us know via https://github.com/OpenAPITools/openapi-generator/issues/new
Generators are still in need of work for the languages I use, but this is the future.
Please share your feedback by opening an issue via https://github.com/OpenAPITools/openapi-generator/issues/new.... Thanks.
Do you mind opening an issue via http://github.com/OpenAPITools/openapi-generator/issues/new with the details? (I assumed you've checked out the auto-generated documentation and that doesn't look good to you.)
There were discussions on type hints but unfortunately no one has found the time to make the contribution yet.
We also have a new `python-experimental` client generator that has better support for new features in OAS v3. Please check it out to see if it works better for you.
I would recommend the `typescript-angular` generator as a starting point for evaluation as it's pretty active and we just added Angular 9 support.
We just added oneOf support to the Java client generator a few weeks ago. The enhancement will be included in the upcoming 4.3.0 release. You can give it a try with the latest snapshot version for the time being.
Ref: https://github.com/OpenAPITools/openapi-generator/pull/5120
You may want to try OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), which supports JS client/server, TS, JS Flow and many other languages for code generation.
There're many IDE plug-ins that integrate with OpenAPI Generator: https://github.com/OpenAPITools/openapi-generator#35---ide-i....
For C++, I don't think anyone has contributed the OAUTH2 enhancement to the C++ client generator (cpp-qt5, cpp-restsdk) yet. We definitely welcome the contributions.
For Java, I agree there are rooms for improvements as we cover so many different libraries (jersey2, retrofit2, openfeign, resttemplate, etc) and a good starting point is https://github.com/OpenAPITools/openapi-generator/tree/maste... and we can plot the OAuth-related enhancements back to the template more easily.
I remember there were discussions about adding typing to the Python client before but I don't think anyone has time to implement it yet. If you've time to make the contribution, please let me know by opening an issue/ticket: https://github.com/OpenAPITools/openapi-generator/issues/new
We've also added a protobuf schema generator (`protobuf-schema`) to convert OpenAPI spec v2,v3 to protocol buffer schemas. Please give it a try to see if it helps in your use cases.
Here is the Q&A: https://github.com/OpenAPITools/openapi-generator/blob/maste...
Another way to compare is as follows:
https://www.openhub.net/p/openapi-generator vs https://www.openhub.net/p/swagger-codegen
FYI. One way to automatically generate API clients is to use OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), which is free, open-source and supports 30+ programming languages.
Disclosure: I'm the top contributor to the project.
Correction for Step 3: I mean "generate an OCaml API client for the Petstore API"
I'm the top contributor to both OpenAPI Generator and Swagger Codegen. Just want to share a bit more to ensure everyone is on the same page.
OpenAPI Generator is a fork of Swagger Codegen. The fork took place in May 2018 - a year ago. For the reasons behind the fork, please refer to the Q&A (https://github.com/OpenAPITools/openapi-generator/blob/maste...).
Fast forward to today, we just released OpenAPI Generator v4.0.0 - the 20th release since the fork, thanks to the awesome contributions from the vibrant developer community. Please refer to the release note (https://github.com/OpenAPITools/openapi-generator/releases/t...) for more information about the release.
For a list of companies and open-source projects using OpenAPI Generator in production, please refer to the project's README (https://github.com/OpenAPITools/openapi-generator/#4---compa...).
I hope you will find OpenAPI Generator useful in your work and personal projects.
Not sure which code generation tool you used but if you've time, please try OpenAPI Generator (https://openapi-generator.tech) and let us know if you've any feedback.
Please give it a try with OpenAPI Generator (https://openapi-generator.tech), which supports both OpenAPI spec v2 and v3 for code generation.
We don't have a VueJS generator in OpenAPI Generator (https://openapi-generator.tech) yet. You may want to play with the JS client generator to start with and we can work with you to create the VueJS generator.
Have you tried the `kotlin-server` generator in the OpenAPI Generator project (https://github.com/OpenAPITools/openapi-generator)?
Disclosure: I'm the top contributor to OpenAPI Generator.
Thanks and here is the link to track future enhancements to the C generator: https://github.com/OpenAPITools/openapi-generator/issues/147...
Thanks for the clarification. You're right. I've created https://github.com/OpenAPITools/openapi-generator/issues/132... for tracking.
We've made some enhancements [1](e.g. OpenAPI 3.0 support) to the Python Flask generator in OpenAPI Generator. For aiohttp support in the Python Flask generator, I don't think anyone is working on that. Please let us know if you've time to make the contribution by opening an issue to start with and we can work with you to make it happen.
(OpenAPI Generator is a fork of Swagger Codegen. For the reasons behind the fork, please refer to the Q&A [2])
[1] https://github.com/OpenAPITools/openapi-generator/pulls?q=is...
[2] https://github.com/OpenAPITools/openapi-generator/blob/maste...
Sorry to hear your negative experience with Swagger Codegen regarding the PRs. Having been "managing" the project for a few years, I agree with you that I've not done a very good job in reviewing and merging all the PRs (239 open PRs as of today) contributed by the awesome community.
Myself and 40+ top contributors have decided to fork Swagger Codegen so as to maintain a community-driven version called OpenAPI Generator [1] with a better governance structure to move the project forward. Now there are 10+ core team members and contributors with proper rights to merge PRs so I think we've better PR management in OpenAPI Generator. Please refer to the Q&A [2] for the reasons behind the fork.
For TypeScript generators, we've recently added the TypeScript Axios client generator [3] and there's an ongoing project to consolidate the TypeScript generators into one [4]. Please check these out and let us know if you've any feedback.
We hope you will find OpenAPI Generator useful in your projects.
[1] https://openapi-generator.tech [2] https://github.com/OpenAPITools/openapi-generator/blob/maste... [3] https://twitter.com/oas_generator/status/1041939441109983232 [4] https://github.com/OpenAPITools/openapi-generator/projects/4
Have you guys considered switching to swagger-ui (https://github.com/swagger-api/swagger-ui)?
This is not to say Google API explorer is bad or swagger-ui is better.
Disclosure: I'm top contributor to Swagger Codegen but not Swagger UI.
Hi, for any feedback on the Go server stub generator, please let us know via https://github.com/swagger-api/swagger-codegen/issues/new.
Also worth sharing with you that the Go client generator in the latest master (2.3.0) has been refactored. Please give it a try and let us know if you've any feedback.
Disclosure: I'm a top contributor Swagger Codegen
Given the Swagger/OpenAPI spec for the DB, one can use Swagger Codegen [1] (free, open-source) to generate API clients, server stubs and API documentations.
Currently the project supports more than 40+ API client generators (C#, Swift, C++, TS, JS, etc) and 20+ server stub generators (C# Nancy, Python Flask, etc). For a full list, please refer to the project README.
[1] https://github.com/swagger-api/swagger-codegen
Discloure: I'm a top contributor to the project.