FusionAuth / fusionauth-client-builder

The FusionAuth client library builder
https://fusionauth.io/
Apache License 2.0
6 stars 24 forks source link

Crystal language support? #19

Open mdwagner opened 4 years ago

mdwagner commented 4 years ago

https://crystal-lang.org/

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.

robotdan commented 4 years ago

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

mdwagner commented 4 years ago

Thanks for the info! I'll give it a shot

robotdan commented 4 years ago

Excellent!