Settings

Theme

Show HN: Stripe-quality API client libraries with a single button click

libninja.com

27 points by kurtbuilds 3 years ago · 10 comments · 2 min read

Reader

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.

jbenn 3 years ago

You're building Rust client libraries at no cost? Why? Seems too good to be true.

dflock 3 years ago

Type in your pricing section: "an polyglot" -> "a polyglot"

codegladiator 3 years 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 ?

  • kurtbuildsOP 3 years ago

    To 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.

ezekg 3 years ago

Seems 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. :)

limelight 3 years ago

Exciting to see Rust's power applied to codegen. It's quickly supplanting Go as the tool of choice for these use cases.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection