Skip to content
SPECIFICTION
Get listed

oapi-codegen vs Swagger Codegen

oapi-codegen

github.com

Swagger Codegen

swagger.io

Side by side

Figureoapi-codegenSwagger Codegen
Price fromFreeFree
Free planYesYes
Free trial——
Open source—Yes
Web—Yes
Windows—Yes
macOS—Yes
LinuxYesYes
API—Yes
Self-hostedYesYes
Plans published12
Spec score · API Generation Software7.5 (#12)8.3 (#3)
Spec score · Code Generators7.5 (#24)8.3 (#9)
CustomizationGenerated Go templates can be overridden, and supported OpenAPI extensions can customize generated types, names, JSON behavior, and struct tags.Users can replace Mustache templates with their own directory and create custom generator modules using the meta command.
Purposeoapi-codegen is a command-line tool and library that converts OpenAPI specifications into Go server implementations, API clients, and HTTP models.Swagger Codegen generates API client libraries, server stubs, and documentation from OpenAPI specifications.
Server generationIt generates server boilerplate for Chi, Echo, Echo v5, Fiber, Fiber v3, Gin, gorilla/mux, Iris, and net/http.The product generates boilerplate server code in more than 20 languages.

Plans

oapi-codegen

  • Open sourceFree

oapi-codegen pricing →

Swagger Codegen

  • Open-source Swagger CodegenFree
  • Swagger CodegenFree

Swagger Codegen pricing →

In their own words

oapi-codegen

oapi-codegen has no write-up on Specifiction yet; its figures are above.

Visit github.com

Swagger Codegen

Swagger Codegen is an open-source tool that generates API client libraries, server stubs and documentation from OpenAPI specifications. Its template-driven engine parses OpenAPI or Swagger definitions and produces project code from schemas. Swagger states that it can generate client SDKs in over 40 languages and server boilerplate in over 20. Listed capabilities include OpenAPI import, schema-to-code generation, project scaffolding, custom templates, an interactive API reference, code samples and a command-line interface. Outputs and integrations include HTML and Confluence Wiki documentation, Apache2 configuration files and JMeter. The project is available from GitHub under the Apache-2.0 license, with a hosted option through SwaggerHub. SwaggerHub can generate code in a selected language and push it to source-control repositories. Supported client targets include C#, Dart, Go, Java, JavaScript, Kotlin, PHP, Python, R, Ruby, Scala, Swift and TypeScript variants. Server targets include ASP.NET Core, Go, Java Vert.x and JAX-RS options. The repository warns that untrusted descriptions may cause code injection.

Visit swagger.io