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

Use @Nonnull annotations on Java models and generate strict TypeScript #16944

Open
2 tasks
jonkoops opened this issue Jul 20, 2021 · 1 comment
Open
2 tasks
Labels
area/admin/client-js kind/enhancement Categorizes a PR related to an enhancement team/ui

Comments

@jonkoops
Copy link
Contributor

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:

Describe alternatives you've considered
Disable null type checks, this is not a solution.

@edewit
Copy link
Contributor

edewit commented Nov 2, 2021

step one created issue 19740 to change types on keycloak to add the annotations and make the types of the lists / create methods better.

@stianst stianst added the kind/enhancement Categorizes a PR related to an enhancement label Nov 11, 2021
@jonkoops jonkoops transferred this issue from keycloak/keycloak-nodejs-admin-client Nov 24, 2022
@ssilvert ssilvert transferred this issue from another repository Feb 8, 2023
@ssilvert ssilvert added this to the Backlog milestone Feb 20, 2023
@stianst stianst removed this from the Backlog milestone Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin/client-js kind/enhancement Categorizes a PR related to an enhancement team/ui
Projects
None yet
Development

No branches or pull requests

4 participants