openapi-generator-go
oapi-codegen
| openapi-generator-go | oapi-codegen | |
|---|---|---|
| 1 | 76 | |
| 111 | 7,909 | |
| 0.9% | 2.4% | |
| 4.8 | 8.8 | |
| 9 months ago | 7 days ago | |
| Go | Go | |
| MIT License | Apache License 2.0 |
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.
openapi-generator-go
oapi-codegen
- Show HN: BoGO – Generate Go back end services directly from SQL files
Very cool, reminds me of both [sqlc](https://sqlc.dev) and [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen)
I'm not a fan of the enterprisey hexagonal-style code this generates, but I can understand where this might be useful for someone who does follow that.
A question regarding evolution: it's rare that schemas stay constant. I'm not sure if this tool will lend itself well when the time comes to, say, add another table, though I might be misunderstanding here.
- Show HN: OpenAPI-TypeScript-server – Codegen TypeScript servers from OpenAPI
I really want the ergonomics of schema-first development from gRPC, combined with the ubiquity of OpenAPI. I couldn't quite find anything I really liked off-the-shelf for node + TypeScript, so I wrote one. It's largely modeled off of https://github.com/oapi-codegen/oapi-codegen for Go.
I've always been excited about OpenAPI and schema-first development, but I'm betting that these artifacts will be extra important in the era of coding agents. Giving the LLM one place to see your entire domain feels like a good way to accelerate the value of these tools. And good for humans, too!
I'm looking for early feedback, suggestions for other projects to look at, moral support, "this is a bad idea" kind of discouragement if necessary, etc.
- ⚙️ Go Tools: Code Generation from OpenAPI Specs in Go with oapi-codegen
🔗 GitHub Repository: oapi-codegen
- Looking back at `oapi-codegen`'s last year
- Goravel: A Go framework inspired by Laravel
A simple Google search returns https://github.com/oapi-codegen/oapi-codegen
I get wanting to be productive and gravitating towards patterns you’re familiar with but in the end it’s all bloat. http can do routing and patterns and cookies and sessions. database/sql can do your DAL work. uuid (various implementations) work for user/tenant uid+oid obfuscation. JWT libs for auth. You can literally json.unmarshal your config for your whole application or use godotenv to use environment variables. template/html for views. Golang has batteries, it’s just you don’t know what you don’t know so you expect a certain perspective that isn’t how we do things. Like joining a new company, things are different here. If you spent some time to learn the “go way” you’d realize that you don’t need the bloat, you just need the structure. The “where I expect it”.
- API testing through simulations
First, let’s set up our development environment. We’ll use OpenAPI Generator within Docker to generate our HTTP client, keeping our local environment clean. For this demonstration, we’ll work with fakerestapi.azurewebsites.net (kudos to the maintainers of public APIs). Here’s our Docker configuration for the client generator:
- gRPC vs. REST: Understand gRPC, OpenAPI and REST and When to Use in API Design
> https://github.com/oapi-codegen/oapi-codegen
I'm using it for a small personal project! Works very well. Thank you!
- Show HN: Find your "holy grail piece", as a service
- Building and Deploying a New API (Part 1)
Moving on to oapi-codegen, a tools.go file has been created as exemplified in its repository. I have also created the file internal/handlers/server.go:
- The value of API-First design on side-projects
To generate the server-side code, we need some library. I found oapi-codegen for that. It supports many popular HTTP libraries (echo, gin, etc.) At the time of writing, I used oapi-codegen@v2.3.0
What are some alternatives?
openapi-processor-spring - an OpenAPI 3.2, 3.1 & 3.0 interface & model java code generator for Spring Boot
ogen - OpenAPI v3 code generator for go
gnostic - A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.
openapi-generator - OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
openapi-generator-maven-plugin-template-customization-example - An example Maven project that uses the OpenAPI Generator Maven plugin with template customization to generate an API model and server
kin-openapi - OpenAPI 3.0 (and Swagger v2) implementation for Go (parsing, converting, validation, and more)