Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crystal language support? #19

Open
mdwagner opened this issue Sep 12, 2020 · 3 comments
Open

Crystal language support? #19

mdwagner opened this issue Sep 12, 2020 · 3 comments

Comments

@mdwagner
Copy link

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
Copy link
Member

robotdan commented Sep 12, 2020

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
Copy link
Author

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

@robotdan
Copy link
Member

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants