oapi-codegen
kin-openapi
Our great sponsors
oapi-codegen | kin-openapi | |
---|---|---|
63 | 6 | |
5,068 | 2,339 | |
5.3% | 4.5% | |
9.0 | 8.4 | |
4 days ago | 6 days ago | |
Go | Go | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
oapi-codegen
-
AsyncAPI Codegen, a code generator from AsyncAPI spec v2 and v3.
During daytime, and especially work time, I used a great tool to generate code from OpenAPI specification: deepmap/oapi-codegen.
-
Created an API using Gin, want to create sdk for him
Then you can use oapi-codegen or openapi-generator to generate the Go (or other language) SDK for it.
-
Create Production-Ready SDKs with Goa
Deepmap OpenAPI code generator
-
Manage DEV Articles with Git and GitHub Actions
Luckily, Forem/DEV is open source and provides great API documentation and specification. I used oapi-codegen to automatically generate a Go API client. Then, I simply had to walk the root articles directory and:
-
Openapi server generation
For Go, I've found https://github.com/deepmap/oapi-codegen/, and it works well.
-
Combining oapi-codegen, echo and validator frameworks to build robust APIs
Iโm using oapi-codegen in my project and I donโt think it ships with a validator.
-
Sharing types between Go backend and TypeScript frontend: best practices and tools?
We're using https://github.com/deepmap/oapi-codegen at work while having an OpenAPI spec. When the spec changes, backend/frontend/mobile regenerate their server/client
- Why is gin so popular?
-
what's your recommended router? chi, mux, something else?
I use oapi-codegen with Echo
-
Golang tech stack
Deepmap oapi-codegen if I'm using OpenAPI
kin-openapi
-
Create Production-Ready SDKs With gRPC Gateway
We'll use the excellent kin-openapi Go library to convert the OpenAPI 2.0 schema to OpenAPI 3.0.
-
OpenAPI Generator allows generation of API client libraries from OpenAPI Specs
What is your language?
I've found kin-openapi to be good for Go:
-
swaggo/swag alternative, but should generate OpenAPI 3.0 spec file
I recently used https://github.com/getkin/kin-openapi openapi2 and openapi2conv to convert the v2 yaml to v3 yaml.
-
Any good OpenAPI 3.x spec generator for a Go REST API?
This might not be very helpful, but I've have found every "generate spec from code" package to be limited sooner or later, and that's across languages. I finally settled on writing the spec file by hand, linting it in CI using openapi-cli, and using kin-openapi in Go tests to ensure responses match their schema.
-
What are your favorite packages to use?
oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).
-
Do you use swagger to generate backends?
Then define the corresponding YAML/JSON specification (again manually) either using Swagger 2.0 (with go-swagger) or OpenAPI 3 (with kin-openapi), and
What are some alternatives?
openapi-generator - OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
GoSwagger - Swagger 2.0 implementation for go
chi - lightweight, idiomatic and composable router for building Go HTTP services
ogen - OpenAPI v3 code generator for go
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
go-oas3 - Open API v3 server code generator
autorest - OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
goa - ๐ Goa: Elevate Go API development! ๐ Streamlined design, automatic code generation, and seamless HTTP/gRPC support. โจ
swagger-petstore - swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
CORS - Go net/http configurable handler to handle CORS requests