You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently we are generating our models based on the Java source from the main Keycloak repo. Since this code is Java all the fields generated in our models are nullable, even if these fields are always present.
This introduces a problem if you are running TypeScript in strict mode, as it will now generate compilation errors when accessing optional fields that are in fact always present. This requires the user to use the non-null assertion operator or to disable strict type checking altogether, introducing possible run-time errors along the way.
Describe the solution you'd like
To mitigate the aforementioned problems we will have to do the following:
Add @Nonnull or @Nullable annotations to all the fields in models of the main repo
Is your feature request related to a problem? Please describe.
Currently we are generating our models based on the Java source from the main Keycloak repo. Since this code is Java all the fields generated in our models are nullable, even if these fields are always present.
This introduces a problem if you are running TypeScript in strict mode, as it will now generate compilation errors when accessing optional fields that are in fact always present. This requires the user to use the non-null assertion operator or to disable strict type checking altogether, introducing possible run-time errors along the way.
Describe the solution you'd like
To mitigate the aforementioned problems we will have to do the following:
@Nonnull
or@Nullable
annotations to all the fields in models of the main reporequiredAnnotations
oroptionalAnnotations
options when generating modelsDescribe alternatives you've considered
Disable null type checks, this is not a solution.
The text was updated successfully, but these errors were encountered: