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

fix: Check for null or empty class name in generate OpenAPI annotations #1398

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

turkeylurkey
Copy link
Contributor

@turkeylurkey turkeylurkey commented Oct 9, 2024

In MicroProfileGenerateOpenAPIOperation we call PsiClass.getQualifiedName() which is nullable. It returns null when the class is local or a type parameter. In our test case we used a type parameter so we see the need to check the return type.

Fixes #1397

Copy link

sonarqubecloud bot commented Oct 9, 2024

@angelozerr
Copy link
Contributor

Good catch! I have never seen that PsiClass.getQualifiedName() could return null. It is very annoying.

I merge your PR, but we need to check withthis problem with null in other code location https://github.com/search?q=repo%3Aredhat-developer%2Fintellij-quarkus%20getQualifiedName&type=code

@angelozerr angelozerr merged commit 7dcfd72 into redhat-developer:main Oct 9, 2024
11 checks passed
@angelozerr
Copy link
Contributor

Thanks @turkeylurkey !

@angelozerr angelozerr added this to the 2.1.0 milestone Oct 9, 2024
@angelozerr angelozerr added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException from generate openapi code action using type parameter
2 participants