OpenAPI-Specification
openapi-generator
Our great sponsors
OpenAPI-Specification | openapi-generator | |
---|---|---|
44 | 232 | |
28,047 | 19,529 | |
1.0% | 3.1% | |
8.6 | 9.9 | |
5 days ago | 3 days ago | |
JavaScript | Java | |
Apache License 2.0 | 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-Specification
-
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
As part of this release, we have decided to not follow SemVer anymore, and as such allow ourselves to introduce minor, but breaking changes. These changes are documented as part of the release notes.
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.
-
Automatic request validation at the edge with OpenAPI and Fastly
The principle behind the OpenAPI Specification (OAS – the industry’s most popular API specification format) is similar. It’s supposed to act as a blueprint for describing RESTful APIs.
-
How would I describe a webhook, as part of my API collection?
OpenAPI 3.1 supports webhooks. It's not widely supported yet by implementations, but it's definitely there. https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.1/webhook-example.yaml
openapi-generator
-
Show HN: Manage on-prem servers from my smartphone
Of course you can compile the server from source if you have Go and the OpenAPI generator JAR (https://github.com/OpenAPITools/openapi-generator?tab=readme...)
Follow these steps : https://github.com/c100k/rebootx-on-prem/blob/master/.github...
And then :
(cd ./impl/http-server-go && GOARCH=amd64 GOOS=openbsd go build -o /app/rebootx-on-prem-http-server-go-openbsd-amd64 -v)
By adapting the arch if needed. Not tested, but it should work.
-
How to Automatically Consume RESTful APIs in Your Frontend
As an alternative, you can also use the official OpenAPI Generator, which is a more generic tool supporting a wide range of languages and frameworks.
-
Building a world-class suite of SDKs is easy with Speakeasy
I trialed generating SDKs using the OpenAPI Generator package, which was largely unsatisfactory.
-
Best way to implement base class for API calls?
If Swagger/OpenAPI is available, save yourself a lot of trouble and generate the client using OpenAPI Generator. If not, use a library like RestEase to make it significantly easier to create the client.
-
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.
-
.NET Blazor
Yep. For frontend use, I think https://www.npmjs.com/package/openapi-typescript is the most widely-used/well-regarded, though https://www.npmjs.com/package/orval seems to me to have some nicer features like react-query support.
There are other options too, I'd just stay away from "_the_ openapi generator" (https://openapi-generator.tech/) which does a pretty poor job IMO.
Disclaimer: I'm the founder of a company doing SDKs commercially, but we don't focus on the frontend right now, and our free plan is still in beta.
-
Using AI To Go From JSON to API in Seconds
Now that I have a solid way to make an Open API spec and get a functioning mock server, I'd like to take it a step further and generate an SDK to call it. Many developers use SDKs to communicate with their backend services, and tools like OpenAPI Generator enable them to do so without having to manually build them. OpenAPI Generator will take an API spec and compile it down into an SDK in the language of your choice, including front-end compatible languages like typescript-fetch.
-
10 quick tips to instantly improve API design
With the development of automatic code generation tools such OpenAPI generator (https://openapi-generator.tech/), the importance of API design rather than implementation is emphasized.
-
10+ API Documentation Tools For Super Busy Developers 👩💻
OpenAPI Generator (Free)
-
Learning Go by examples: part 11 - Generate a Go SDK (API client library) from your Go REST API
In short, OpenAPI Generator allows generation of API client librairies (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3).
What are some alternatives?
NSwag - The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
oapi-codegen - Generate Go client and server boilerplate from OpenAPI 3 specifications
SvelteKit - web development, streamlined
smithy - Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
autorest - OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
smithy-go - Smithy code generators for Go (in development)
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.
Feign - Feign makes writing java http clients easier
swagger-typescript-api - TypeScript API generator via Swagger scheme
io-ts - Runtime type system for IO decoding/encoding
GoSwagger - Swagger 2.0 implementation for go