16

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.

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.

Update - Add OpenAPI Generator (Jul 2018)

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

Grokify
  • 15,092
  • 6
  • 60
  • 81

4 Answers4

11

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.

William Cheng
  • 10,137
  • 5
  • 54
  • 79
7

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.

pHiL
  • 1,722
  • 18
  • 19
2

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.

samy
  • 1,396
  • 2
  • 19
  • 41
  • The benefits or a client-side SDK would typically be greater in strongly-typed languages. Modeling inputs/outputs/exception types are primary examples. On the contrary, both {strong,weakly}-typed languages would benefit from auth config, and maybe some routing (if the generator supported that in weak languages). – Jmoney38 Feb 15 '19 at 02:16
1

Square uses it in production. Here is an article by them about it and it has links to their GitHub Swagger setup, resultant APIs and more.

https://swagger.io/blog/api-strategy/how-square-makes-its-sdks/

This article mentions the following SDKs:

You can see the all of the templates and config files that power the {Java, PHP, C#, Python, Ruby, JavaScript} SDKs in the same repository as our specification file: Connect-API-Specification.

Heree are some of their SDKs:

Grokify
  • 15,092
  • 6
  • 60
  • 81
garafajon
  • 1,278
  • 13
  • 15