The Crystal Programming Language Forum

Crystal API Client Generator

Hi all,

We’ve just added a Crystal client generator to the openapi-generator project:

Please give it a try by following 3 simple steps below:

  1. Download the Java JAR:

  2. Rename the JAR as “openapi-generator-cli.jar”

  3. Execute the following command to run the generator for the Petstore API:


$ java -jar openapi-generator-cli.jar generate -g crystal -i -o /var/tmp/crystal-client/

I’m new to crystal so the output may not look best. Welcome feedback, PRs to further improve it.


URL to the Github repo: GitHub - OpenAPITools/openapi-generator: OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

UPDATE: the crystsal client generator has been included in the OpenAPI Generator v5.0.1 release: Release v5.0.1 released · OpenAPITools/openapi-generator · GitHub


This is fantastic! Thank you so much for this!

1 Like

I just tried it out, way too ambitiously — I got a little excited and ran it against the Stripe OAS3 definition. :-D Just opened up a PR to fix some of the issues I saw.

When I get a bit more time I’ll look through it some more (I’m stumbling on rebuilding the Maven package at the moment), but I hope that PR helps move it forward.

I’m a little behind the times on generating API clients, but I’ve at least come around to the idea and I’m really excited about this! Thank you so much for working on it!


Thanks for the PR, which has been merged.

1 Like

I have generated a working google drive v3 crystal client with my custom templates.

You can try my custom templates to generate other crystal clients.

Bug reports are welcome!


Exciting news!
I managed to generate a working twilio crystal client with some minor modifications and also fixed a few bugs in my custom templates.

I have verified that it could at least send/list text messages and make/list phone calls successfully.

I’ll try the stripe spec file when I have time.