OpenAPI-Specification
grpc-gateway
OpenAPI-Specification | grpc-gateway | |
---|---|---|
47 | 30 | |
29,104 | 18,272 | |
0.5% | 0.6% | |
9.8 | 9.9 | |
5 days ago | 6 days ago | |
Markdown | Go | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" 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.
OpenAPI-Specification
- OpenAPI 3.1.1 Specification
-
Log Streaming - what we got wrong and how we fixed it
gRPC A little more background on how our control-plane used to work: we had an HTTP-based API gateway that talked to our gRPC monolithic backend service.6 We thought about extending gRPC streaming from our backend to clients…but the API-gateway handled auth and connections for us and doing gRPC in our Javascript frontend wasn’t something we wanted to take on and in addition it meant that we wouldn’t be able to curl our endpoints easily. To me there’s nothing quite like curl localhost:8000 to begin understanding a service.7 Websockets Websockets would have been fun, but truthfully we didn’t need ‘em, the communication we wanted was really just getting output to our users quickly and we didn’t really need bi-directional communication. Server-Sent Events Server Sent Events (SSE) is pretty cool, enabling sending real-time updates to clients. SSE is well-supported by browsers and you can also “just curl it!”. One of the only drawbacks for us was the OpenAPI support wasn’t great at the time (see this), but our frontend team was able to work around it and in addition there wasn’t a tightly defined model for the logs output, so the benefits of using our spec (strict types) weren’t as big here compared to other parts of our API.
-
Understanding FastAPI: How OpenAPI works
If we go to the OpenAPI's repository, we'll see that:
-
Writing type safe API clients in TypeScript
And I'll be using the OpenAPI Pet Store spec file as an example.
-
Show HN: OpenAPI DevTools – Chrome ext. that generates an API spec as you browse
I saw your sibling comment about "keeping it simple," however that is a bit counter to "generates OpenAPI specifications" since those for sure are not limited to just application/json request/response bodies
I wanted to draw your attention to "normal" POST application/x-www-form-urlencoded <https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/vers...> and its multipart/form-data friend <https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/vers...>
The latter is likely problematic, but the former is in wide use still, including, strangely enough, the AWS API, although some of their newer services do have an application/json protocol
I know that's a lot of words, but the tl;dr would be that if you want your extension to be application/json only, then changing the description to say "OpenAPI specifications for application/json handshakes" would help the consumer be on the same page with your goals
-
How to Connect a FastAPI Server to PostgreSQL and Deploy on GCP Cloud Run
Since FastAPI is based on OpenAPI, at this point you can also use the automatically generated docs. There are multiple options, and two are included by default. Try them out by accessing the following URLs:
-
Write a scalable OpenAPI specification for a Node.js API
This approach requires a constant context switch and is clearly not productive. Here, the OpenAPI Specification can help; you might already have it, but is it scalable? In this article, we’ll learn how to create an OpenAPI Specification document that is readable, scalable, and follows the principle of extension without modifying the existing document.
-
OpenAPI 3.1 - The Gnarly Bits
Phil Sturgeon, who along with Ben Hutton and Henry Andrews from the JSON Schema community, helped drive the push to full JSON Schema Draft 2020-12 compliance, has written a blog post for the official OpenAPIs.org website on how to transition your OAS documents from v3.0.x to v3.1.0.
-
Documenting Node.js API using Swagger
In this article, we will be learning how to document API written in Node.js using a tool called Swagger. Swagger allows you to describe the structure of your APIs so that machines can read them. The ability of APIs to describe their own structure is the root of all awesomeness in Swagger. Why is it so great? Well, by reading our API’s structure, swagger can automatically build beautiful and interactive API documentation. It can also automatically generate client libraries for your API in many languages and explore other possibilities like automated testing. Swagger does this by asking our API to return a YAML or JSON that contains a detailed description of your entire API. This file is essentially a resource listing of our API which adheres to OpenAPI Specifications.
-
Getting started with REST APIs
You may encounter APIs described as RESTful that do not meet these criteria. This is often the result of bottom-up coding, where top-down design should have been used. Another thing to watch out for is the absence of a schema. There are alternatives, but OpenAPI is a common choice with good tools support. If you don't have a schema, you can create one by building a Postman collection.
grpc-gateway
-
I write HTTP services in Go after 13 years (Mat Ryer, 2024)
it lacks flexibility but i really enjoy grpc-gateway for 99% of my work
https://github.com/grpc-ecosystem/grpc-gateway
-
Create Production-Ready SDKs With gRPC Gateway
gRPC Gateway is a protoc plugin that reads gRPC service definitions and generates a reverse proxy server that translates a RESTful JSON API into gRPC.
-
Ask HN: Rapid Development API-Only One Person Stack – Seeking Performant Tech
I don't have any example that's public atm, but the guide in grpc-gateway is pretty clear/can be followed step by step.
https://github.com/grpc-ecosystem/grpc-gateway
To integrate with Fiber, I used the Fiber Adaptor (also pretty straightforward): https://docs.gofiber.io/api/middleware/adaptor
-
Seeking advice on implementing a tinyurl-like service using Go and gRPC.
I wonder if they would be happy with something like this: https://github.com/grpc-ecosystem/grpc-gateway
- How do I provide bot RPC and REST endpoints?
-
Reasons to use gRPC/Protobuf?
Protobuf is used is massively scaled services like firebase. But you'll still see JSON in streamed realtime services like AWS Kinesis. Hopefully google had a return on investment for creating and using this protocol, but it's not hard to prove that it's far from essential. Out of apparent convenience I use grpc-gateway so I can expose both Protobuf and JSON, but honestly I wouldn't do it again
-
gRPC microservices communication in kubernates
GRPC is an alternative to rest, rest and GRPC both use the http protocol. But you won’t be able to use fetch to call a GRPC endpoint, you should look into setting up a GRPC proxy within the application(hopping you have access to the source code) grpc-gateway. If you don’t have access you’ll have to create a new container that proxies the calls
-
Question about gRPC?
(There is an option called google.api.http, that lets you set up a URL that can be used to make HTTP/1 REST requests, which get translated to gRPC calls if you're using grpc-gateway as a proxy in front of your service. That has nothing to do with the requests that are made by gRPC clients and servers themselves.)
-
Issues with proxying gRPC services to web, and a potential prototype
Have you looked at https://github.com/grpc-ecosystem/grpc-gateway ?
-
Understanding gRPC Concepts, Use Cases & Best Practices
protoc-gen-grpc-gateway — plugin for creating a gRPC REST API gateway. It allows gRPC endpoints as REST API endpoints and performs the translation from JSON to proto. Basically, you define a gRPC service with some custom annotations and it makes those gRPC methods accessible via REST using JSON requests.
What are some alternatives?
supertest - 🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
examples - A repository to host examples and tutorials for Gin.
Cypress - Fast, easy and reliable testing for anything that runs in a browser.
MassTransit - Distributed Application Framework for .NET
api-guidelines - Microsoft REST API Guidelines
Kreya - Kreya is a GUI client for REST and gRPC with innovative features for environments, authorizations and more.
google.aip.dev - API Improvement Proposals. https://aip.dev/
grpc-web - gRPC for Web Clients
redoc - 📘 OpenAPI/Swagger-generated API Reference Documentation
openapi3 - OpenAPI 3.0 data model
swagger-tools - A Node.js and browser module that provides tooling around Swagger.
buf - The best way of working with Protocol Buffers.