Crystal language support?
mdwagner opened this issue · 3 comments
I know it's a small language popularity wise, but it's something I'm currently using for FusionAuth. I'm just using REST calls to FusionAuth, but would like know if it's an option for FusionAuth to just support it directly. Crystal has a very similar syntax to Ruby, so I would hope that makes it easier.
I'm also open to contribute by adding the implementation as well.
Thanks for the suggestion.
We are exploring Open API which may let us more easily build out additional clients.
In the mean time, if you wanted to take a crack at it - here is the Ruby template we use to build the library.
https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/ruby.client.ftl
There may be some updates to make to any macros used by the Ruby client as well.
https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/_macros.ftl
If you were to hack on that as a starting point and submit a PR for crystal.client.ftl
would be great.
A quick summary on how the builder works, in the template you'll see we essentially just loop over each API which is just our DSL. Each API definition is here: https://github.com/FusionAuth/fusionauth-client-builder/tree/master/src/main/api
The templates are coded in Apache FreeMarker.
If you set up the build environment, you can iterate on it by building the library until the syntax is correct. You could copy/paste the ruby build target for Crystal. https://github.com/FusionAuth/fusionauth-client-builder/blob/master/build.savant
Thanks for the info! I'll give it a shot
Excellent!