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

Java build fails with schemaToBind is null issue ( version 6.12.3 onwards) #1825

Closed
vinay-sethi opened this issue Oct 23, 2024 · 7 comments · Fixed by #1840
Closed

Java build fails with schemaToBind is null issue ( version 6.12.3 onwards) #1825

vinay-sethi opened this issue Oct 23, 2024 · 7 comments · Fixed by #1840

Comments

@vinay-sethi
Copy link

Expected Behavior

Java build should be completed successfully

when i use 6.12.2, everything works fine.

Actual Behaviour

Note: Generating OpenAPI Documentation

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.media.Schema.getExample()" because "schemaToBind" is null

Steps To Reproduce

update the below dependency
annotationProcessor(group: 'io.micronaut.openapi', name: 'micronaut-openapi', version: '6.12.3')

Environment Information

JDK 17

Example Application

No response

Version

4.6.+

@altro3
Copy link
Collaborator

altro3 commented Oct 24, 2024

Try to use micronaut-openapi 6.13.0. If problem still exists. Please add a simple reproducer for this bug

@altro3
Copy link
Collaborator

altro3 commented Oct 25, 2024

@vinay-sethi ping

@vinay-sethi
Copy link
Author

it was happening with 6.13.0 as well... will add a simple reproducer soon.

@altro3
Copy link
Collaborator

altro3 commented Oct 30, 2024

@vinay-sethi any news? Want to fix it for release 6.13.1

@vinay-sethi
Copy link
Author

pi-seed-app-java.zip
@altro3 i have uploaded a simple reporducer.
it application starts locally with 6.12.2 but fails to start with 6.12.3 , 6.13.0

@altro3
Copy link
Collaborator

altro3 commented Oct 31, 2024

@vinay-sethi Well, the problem was not in micronaut openapi, but in your code. You specified an incorrect value in the schema type. Micronaut openapi was not ready for such crooked data :-)

{37636F1C-2716-4488-B41B-7E07F001E146}

But I agree that such a situation should be handled more correctly. I added a check and next time you will see this message:

Error reading Swagger Schema for element [id]: {"type":"query"}

@vinay-sethi
Copy link
Author

@altro3 thanks for pointing that out. the same code working in 6.12.2 is what threw me off.

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

Successfully merging a pull request may close this issue.

2 participants