3 ms·
Show HN: Stripe-quality API client libraries with a single button click
TL;DR- Libninja will generate world-class client libraries for you, without you needing to fiddle with openapi-generator, maintain build pipelines, and so forth.
If you just want Rust, reach out, and I'll create your client library at no cost, because I want to help Rust's ecosystem grow.
--
Hi HN,
I got into Rust in a big way about 9 months ago.
While the language is quickly maturing, one large gap in the ecosystem is immature or non-existent client libraries for common API services like Plaid, Stripe, Twilio, Github, Slack, and so on.
The existing openapi-generator templates create Rust libraries that don't even compile out of the box, so I started down the rabbit hole of creating a Rust-based toolchain to generate Rust client libraries based on an OpenAPI spec.
Rust is an incredible language to build codegen tools in, because of algebraic data types, Rust macro system, and Rust's incredibly powerful libraries for AST transformation (quote, syn, and more - almost solely due to dtolnay - thank you!)
Before long, I realized it's a common painpoint for API companies to maintain build pipelines, tweak openapi-generator templates, and so forth, to get client library generation working.
I added support for more languages, and soon after, Libninja was born.
If you're an API company, Libninja will generate world-class client libraries for you.
Client libraries:
- help your users integrate faster (meaning you get revenue faster)
- reduce the number of bug reports and support requests (because there's no ambiguity about using your API)
- Give your users a phenomenal developer experience (editor autocomplete, API documentation in docstrings, and more)
PS- If you just want a Rust client, reach out, and I'll create your client library at no cost, because I want to help Rust's ecosystem grow.
- limelight 4y agoExciting to see Rust's power applied to codegen. It's quickly supplanting Go as the tool of choice for these use cases.
- ezekg 4y agoSeems to only work for APIs with an OpenAPI spec. Anybody know of a service that can generate an OpenAPI spec for an API that doesn't have one? And keep it up to date. :)
- bryan_cooper 4y agoSwagger does a good job of this with a little help from decorators in Typescript
- kurtbuilds 4y agoAre there APIs you have in mind? One tool we have under development is a tool (might end up being a chrome extension) that will analyze web requests to turn them into a spec. There are a few tools that are similar in purpose, though I've only seen ones based on proxying, rather than chrome's network request recording. - https://github.com/alufers/mitmproxy2swagger https://github.com/alufers/mitmproxy2swagger - https://github.com/adafruit/openapi-mitm https://github.com/adafruit/openapi-mitm
- ndimares 4y agoWe built something like this. SDK you can drop into your API code, then we generate an OpenAPI spec based off of your traffic. Demo here: https://www.loom.com/share/c5b242d25de84e1d95b03fd35eab7099 https://www.loom.com/share/c5b242d25de84e1d95b03fd35eab7099
- jbenn 4y agoYou're building Rust client libraries at no cost? Why? Seems too good to be true.
- codegladiator 4y ago>> Paste the URL of an OpenAPI spec below, and we'll show you example code for calling any of your APIs. > Paste a URL containing a OpenAPI yaml file... >> JSON.parse: unexpected character at line 1 column 1 of the JSON data YAML or JSON ?
- kurtbuilds 4y agoTo clarify, the JSON parse error was data coming down from the server. The code generator accepts either a JSON or a YAML OpenAPI document. I was looking at the server logs - are you the payments company with abbreviation CP? It looks like there are a few errors in your OpenAPI doc that prevented the generator for working in your case - I'm sorry the error message wasn't more clear. If you're interested, email me, kurt at libninja dot com, and I can describe the spec issues and we can chat about working together.
- dflock 4y agoType in your pricing section: "an polyglot" -> "a polyglot"
- kurtbuilds 4y agoThank you - fixed!