Skip to content
SPECIFICTION
Get listed

oapi-codegen vs TypeSpec

oapi-codegen

github.com

TypeSpec

typespec.io

Side by side

Figureoapi-codegenTypeSpec
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Web—Yes
Windows—Yes
macOS—Yes
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · API Generation Software7.5 (#12)8.2 (#4)
Spec score · Code Generators7.5 (#24)8.2 (#12)
IntegrationsIt can be installed as a Go tool or binary and used with go:generate; the project also documents Renovate for updating a pinned configuration schema.The VS Code extension can import TypeSpec from existing OpenAPI 3 definitions and emit code from TypeSpec.
Purposeoapi-codegen is a command-line tool and library that converts OpenAPI specifications into Go server implementations, API clients, and HTTP models.TypeSpec is a language for designing APIs and data models, then generating schemas, API specifications, code, and documentation.

Plans

oapi-codegen

  • Open sourceFree

oapi-codegen pricing →

TypeSpec

  • TypeSpecFree

TypeSpec pricing →

In their own words

oapi-codegen

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

Visit github.com

TypeSpec

TypeSpec is a language for defining API shapes and data models, then producing schemas, API specifications, code, and documentation. Its standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf. OpenAPI output can feed tools for API gateways, code generation, and validation; JSON Schema output can be used to validate data built from shared models. The HTTP library’s `@useAuth` decorator lets authors attach documented security schemes—including HTTP authentication, API keys, OAuth2, and OpenID Connect—to services, interfaces, or operations. Editor support for Visual Studio Code and Visual Studio includes syntax help and completion; the VS Code extension adds diagnostics, formatting, quick fixes, refactoring, and documentation preview. Users can extend TypeSpec with emitters and decorators. The CLI is available through npm for Node.js or as an experimental standalone executable, and a browser playground is available. TypeSpec is open source and free: free. Its emitter framework is experimental, and client emitters for JavaScript, Python, Java, and C# are in preview.

Visit typespec.io