FusionAuth / fusionauth-client-builder

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

Make some enums nullable #24

Closed EPRenaud closed 3 years ago

EPRenaud commented 3 years ago

In C#, enums are just glorified int and are therefore not nullable. The default value is the associated enum value of the int 0.

Fix https://github.com/FusionAuth/fusionauth-netcore-client/issues/31

robotdan commented 3 years ago

Thanks @EPRenaud - this seems like a good idea. Ideally we'd solve this for all enum's.

For example, the JSON DSL for the domain object will look something like this:

{
  "packageName" : "io.fusionauth.domain",
  "type" : "KeyType",
  "enum" : [ "EC", "RSA", "HMAC" ]
}

I wonder if we can use the enum field value here instead of type to make this nullable so that we cover all enums.

I can accept the PR and then investigate if we can add a more comprehensive change to make enums nullable.