Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openapi tools generator vs swagger codegen

I am lost in dependencies and tools: I previously use the following tool to generate code for my swagger webservices.

swagger-codegen-cli

  • https://mvnrepository.com/artifact/io.swagger.codegen.v3/swagger-codegen-cli/3.0.13
  • https://github.com/swagger-api/swagger-codegen

Then I noticed the following tool, and thought this was a successor:

openapi tools generator

  • https://github.com/OpenAPITools/openapi-generator
  • https://openapi-generator.tech/docs/installation.html

But the code that is generated uses different annotations and seems older.

Could somebody tell me, are these 2 tools related to eachother and which one is the more recent version?

like image 204
bvdb Avatar asked Oct 21 '19 08:10

bvdb


People also ask

What is the difference between OpenAPI and swagger?

OpenAPI and Swagger used to refer to the same thing. While there are differences today (OpenAPI refers to RESTful API design and Swagger refers to a set of SmartBear tools), this blog will use the terms interchangeably. If you develop software today, chances are you are developing web APIs as well.

What is OpenAPI codegen?

OpenAPI Generator focuses on ease of use; it positions itself as being a tool for reducing the burden on new development and technologies through the integration and leveraging of OpenAPI documents. Notably, OpenAPI Generator is a fork of swagger-codegen between versions 2.3. 1 and 2.4.

What is Swagger codegen for?

Swagger Codegen is an open source project which allows generation of API client libraries (SDK generation), server stubs, and documentation automatically from an OpenAPI Specification.

What is codegen tool?

CodeGen is a tool that software developers who are working in a Synergy development environment (Synergy/DE) can use to generate source code. That code is often Synergy Language code, but could also be source code for some other programming language.


3 Answers

From the OpenAPI Generator FAQs

What is the difference between Swagger Codegen and OpenAPI Generator?

Swagger Codegen is driven by SmartBear while OpenAPI Generator is driven by the community. More than 40 top contributors and template creators of Swagger Codegen have joined OpenAPI Generator as the founding team members. For more details, see the Fork Q&A.

Swagger is a trademark owned by SmartBear and the use of the term "Swagger" in this project is for demo (reference) purposes only.

like image 178
user210757 Avatar answered Oct 23 '22 13:10

user210757


One way to compare open-source projects is using https://openhub.net.

e.g. OpenAPI Generator vs Swagger Codegen.

From the activity and community graphs, openapi-generator seems to be a lot more active.

like image 14
jellycode Avatar answered Oct 23 '22 14:10

jellycode


Its seems that openapi is in a messy state currently. I'm also confused on which generator to use... And I want to write a custom generator.

GRPC is in a much better state. Every generator is a plugin and the core is well maintained, are the community is not forking.

Update:

Our company has agreed to keep using OpenAPI. We're now using the new OpenSource variant of OpenAPI: openapi-generator.tech/

We've extended the python generators to tweak the generated code. We're also using client generators in TypeScript and considering Kotlin and Swift for our mobile apps.

In the end it works well. If you're not ready to go binary with GRPC, OpenAPI is a nice alternative. It does requires a bit more, my experience with GRPC is that its a no-brains solution. "It Just Works".

But your miles may vary.

like image 7
TjerkW Avatar answered Oct 23 '22 14:10

TjerkW