openapi-mock
oapi-codegen
openapi-mock | oapi-codegen | |
---|---|---|
2 | 74 | |
505 | 7,293 | |
0.2% | 2.2% | |
0.0 | 8.7 | |
about 1 year ago | 13 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-mock
-
How to Automatically Consume RESTful APIs in Your Frontend
Since the OpenAPI can effectively describe our resources, we can reuse it to generate a dummy server that can be later used for development and testing purposes without bootstrapping any actual services. There some tools available that can help us with this task, such as Prism, OpenAPI Mock, OpenAPI Backend and the MSW library we have already seen.
- Eskimo is a supercharged mocking server for developers and testers, that aims to abstract the complexities of coding a mock server into simple JSON configurations.
oapi-codegen
-
⚙️ 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 [email protected]
- TypeSpec: A New Language for API-Centric Development
-
The Stainless SDK Generator
what’s the difference between this and https://github.com/deepmap/oapi-codegen
What are some alternatives?
typed-openapi - Generate a headless Typescript API client from an OpenAPI spec - optionally with a @tanstack/react-query client using queryOptions
ogen - OpenAPI v3 code generator for go
swagmock - Mock data generator for swagger api
openapi-generator - OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
gnostic - A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.
CORS - Go net/http configurable handler to handle CORS requests