speakeasy
swagger-typescript-api
speakeasy | swagger-typescript-api | |
---|---|---|
7 | 15 | |
140 | 2,917 | |
12.9% | 2.4% | |
9.8 | 5.4 | |
1 day ago | 5 days ago | |
Go | TypeScript | |
GNU General Public License v3.0 or later | 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.
speakeasy
-
Generating Code Without Generating Technical Debt?
I’ve built conviction that code generation only gets useful in the long term when it is entirely deterministic, or filtered through humans. Otherwise it is almost always technical debt. Hence LLM code generation products are a cool toy, but no sensible teams will use them without an amazing “Day 2” workflow.
As an example, in my day job (https://speakeasyapi.dev), we sell code generation products using the OpenAPI specification to generate downstream artefacts (language SDKs, terraform providers, markdown documentation). The determinism makes it useful — API updates propagate continuously from server code, to specifications, then to the SDKs / providers / docs site. There are no breaking changes because the pipeline is deterministic and humans are in control of the API at the start. The code generation itself is just a means to an end : removing boilerplate effort and language differences by driving it from a source of truth (server api routes/types). Continuously generated, it is not debt.
We’ve put a lot of effort into trying to make an LLM agent useful in this context. However giving them control of generated code directly means it’s hard to keep the “no breaking changes”, and “consistency” restrictions that’s needed to make code generation useful.
The trick we’ve landed on to get utility out of an LLM in a code generation task, is to restrict it to manipulating a strictly typed interface document, such that it can only do non-breaking things to code (e.g. adjust comments / descriptions / examples) by making changes through this interface.
- Show HN: OpenAPI to Terraform Provider Code Generation
-
HashiCorp silently amend Terraform Registry TOS
In my mind the analagous behaviour would be if the golang checksum database added in license terms that stated "you need to abide by a BSL to use data from this service". What that actually would mean is so nebulous that it feels threatening.
[0] Source: https://registry.terraform.io/v1/providers/airbytehq/airbyte...
[1] Source: https://github.com/airbytehq/terraform-provider-airbyte/tree... gzipped : ~300 resources, ~300 data sources
(NB: in airbyte's case the TF Provider was generated from a ~150Kb OpenAPI spec via https://speakeasyapi.dev: implying docs could be compressed even more)
-
OpenAPI v4 Proposal
I'm working on a company https://speakeasyapi.dev/ with the goal helping companies in this ecosystem get great production quality client sdks, terraform providers, cli(s) and all the developer surfaces you may want supported for our API. We also manage the spec and publishing workflow for you so all you have to do is build your API and we'll do the rest.
Feel free to email me at [email protected] or join our slack (https://join.slack.com/t/speakeasy-dev/shared_invite/zt-1cwb...) . We're in open beta and working with a few great companies already and we'd be happy for you to try out the platform for free!
-
Idiomatic Golang Client SDK Generation for OpenAPI APIs
Hi all I am a founding engineer for a API Experience company called Speakeasy - speakeasyapi.dev and we have recently released a Client SDK Generator for APIs using OpenAPI 3.0.X documents (soon to support 3.1). The generator will generate idiomatic Golang SDKs (along with other languages) that feel natural to use, easy to mock, and just work. The generator is free to use and can be run via a standalone golang built CLI with no external dependencies that can be easily installed as a binary or via homebrew (mac & linux). Check it out here https://github.com/speakeasy-api/speakeasy. If you have any questions or want to get in touch to see how Speakeasy can help you improve your APIs, just let me know!
-
Idiomatic SDKs for OpenAPI
The generator has been battle tested on thousands of APIs and we are sharing the results in our github repo. If you want to try it out on your own, download the CLI or brew install and get started in minutes:
swagger-typescript-api
-
Generative HTTP API Clients
RESTful APIs via swagger-typescript-api
-
Gentle Introduction To Typescript Compiler API
TypeScript API generator via Swagger scheme
- JavaScript Gom Jabbar
-
OpenAPI v4 Proposal
You said it yourself — the “official” generator is awful and very hard to modify or extend (well, you didn’t say that, but I’m saying it) and while there are many alternatives, they’re not always easy to find. I had some success with swagger-typescript-api[1], but eventually got tired of it and wrote my own generator. Despite looking around quite a bit at what’s available, I never heard of openapi-codegen, which looks quite good.
[1]: https://github.com/acacode/swagger-typescript-api
-
Fastest Way to Auto Generate Types for Typescript and ZOD Schema
A lot of APIs nowadays have a Swagger / OpenAPI spec. You can autogenerate types from that using tools like swagger-typescript-api.
-
I am so bad at connecting and debugging APIs
With such a contract your BE team should provide a https://swagger.io/tools/swagger-ui/ where the API definition can easily be viewed and tested. Also you can use generators to basically generate a boilerplate (types for all models, functions for all requests) for the entire API based on a contract: https://github.com/acacode/swagger-typescript-api This his already saved me months of work.. great tool.
-
Is putting all api calls in map actions and map getters a recommended pattern?
If your backend is using Swagger, I'd highly recommend using the package swagger-typescript-api. It auto-generates your types and endpoints for you, based on a swagger.json file, which then simplifies where I store my API calls. The flexibility of this is that I can use these API calls in components, classes, Vuex, etc., and I'm not tied to something that I have to maintain as a UI dev.
- Making an API wrapper with TypeScript
- Swagger-autogen with Typescript
-
[AskJS] What's a good option for building a backend with minimal glue code for the frontend?
If your backend is able to generate Swagger/OpenAPI JSON, you can use https://github.com/acacode/swagger-typescript-api to generate both TypeScript interfaces and an API client from the Swagger JSON.
What are some alternatives?
fern - 🌿 Stripe-level SDKs and Docs for your 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)
openapi-codegen - A tool for generating code base on an OpenAPI schema.
swagger-ui - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
terraform-provider-stateful - Generic abstract stateful resources to manage arbitrary objects by executing arbitrary commands
fastify-typescript-generator - generates new fastify applications in everyone's favourite language typescript with various options to choose from based on your project needs
taxilang - Taxi is a language for describing APIs, data models, and how everything relates
NSwag - The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
para - Para - community plugin manager and a "swiss army knife" for Terraform/Terragrunt - just 1 tool to facilitate all your workflows.
NetHack - Official NetHack Git Repository
oatx - Generator-less JSONSchema types straight from OpenAPI spec
openapi-typescript-codegen - NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification