Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does anyone use Swagger Codegen or OpenAPI Generator SDKs in Production?

Swagger Code Generator can generate SDKs in many languages (listed below from the Github project page). Does anyone use any of Swagger's auto-generated SDKs in production, both as alpha/beta and as GA, and if so, what organizations and for what languages?

I've done some Google searches and asked around. While I have found many examples of Swagger UI deployed, I haven't found any Code Gen SDKs yet.

Project page: https://github.com/swagger-api/swagger-codegen

Languages:

$ ls -1 modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/
AndroidClientCodegen.java
AsyncScalaClientCodegen.java
CSharpClientCodegen.java
JavaClientCodegen.java
JaxRSServerCodegen.java
NodeJSServerCodegen.java
ObjcClientCodegen.java
PhpClientCodegen.java
PythonClientCodegen.java
RubyClientCodegen.java
ScalaClientCodegen.java
ScalatraServerCodegen.java
SpringMVCServerCodegen.java
StaticDocCodegen.java
StaticHtmlGenerator.java
SwaggerGenerator.java
SwaggerYamlGenerator.java
TizenClientCodegen.java

Update - Major Project Official SDK Tracking (Jun 2018)

I'm keeping a track of identifiable official codegen SDKs from larger organizations here to better track adoption. Many organizations that list themselves as using some codegen projects haven't published SDKs on their GitHub accounts.

  • https://github.com/grokify/api-specs/blob/master/official_codegen_sdks.tsv

Update - Personal Experience (Dec 2017)

I've been actively using Swagger Codegen for Go now (2.2.3 - 2.3.1). So far my experience has been that it does a decent job but variety of hand tweaks can be necessary to get a working SDK so a GitHub package/repo is still nice. You can see some of the issues in the GitHub issues for the SDKs I maintain. I also add post processing to the codegen/swagger_codegen_command.sh files in each repo.

  • https://github.com/grokify/go-aha
  • https://github.com/grokify/go-ringcentral
  • https://github.com/grokify/go-visa
  • https://github.com/grokify/go-voicebase-v3

Update - Add OpenAPI Generator (Jul 2018)

OpenAPI Generator is a fork of Swagger Codegen so this is now mentioned as well.

like image 846
Grokify Avatar asked May 20 '15 07:05

Grokify


People also ask

Can swagger be used for production?

We should not enable swagger in production due to security threats. In.net core version 6.0 version, we can protect it with the below code in Program. cs.

What is swagger codegen used 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 the use of OpenAPI generator?

OpenAPI Generator is a tool designed to create API client libraries, server stubs, configurations, and documentation from OpenAPI 2.0 and 3. x documents. It boasts a wide range of functions and is used by a wide range of users, some of whom are also maintainers.

What is swagger Client SDK?

A client SDK contains wrapper classes that you can use to call the API from your application without having to deal with HTTP requests and responses. Anyone can generate an SDK for any API – you do not need a SwaggerHub account or to be an API owner.


3 Answers

I did a search in Github and found some projects (SDKs) generated by Swagger-Codegen.

Here is one example: Online Convert API2 Swift SDK

You can also refer to the Swagger-Codegen Github page for discussion on use case of Swagger-Codegen

UPDATE: Here are some but not all companies/projects using Swagger Codegen in production: https://github.com/swagger-api/swagger-codegen#companiesprojects-using-swagger-codegen

Note: As of July 2017, Swagger Codegen offers more than 70 generators for API client, server stubs and API documentations.

UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.

like image 112
William Cheng Avatar answered Oct 18 '22 23:10

William Cheng


As a platform architect and DevOps, I can say I successfully introduced it into a project which uses Dreamfactory API Automation as BaaS and APIs are defined by swagger. So the SDKs for the mobile app aswell as internal applications are generated with swagger-codegen. We encountered a few bugs in the swagger-codegen template for our languages, which were fairly easy to fix. Overall it saved alot time and reduces potential sources of error.

like image 7
pHiL Avatar answered Oct 18 '22 22:10

pHiL


I used it to bootstrap our API based on the spring codegen and now use it to change and add the domain models and API endpoints. You still have to change some aspects of the generated classes but it makes refactoring very painless and prevents me from piling on technical debt. Its extremely helpful to have the generated swagger-ui for manual testing and you can import the spec to Postman which generate stubs so you have a nice starting point for and TODO overview for writing your tests.

Haven't used the SDKs yet though. I tried to use the various js clients but they didn't provide any advantage over simple fetch libraries.

I see great potential in codegen for more complex js frameworks like Angular or React + Redux and also test automation.

like image 2
samy Avatar answered Oct 18 '22 22:10

samy