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

Springdoc 2.8.x + Spring Boot 3.4.1 breaks native image support #2870

Closed
goafabric opened this issue Jan 21, 2025 · 3 comments
Closed

Springdoc 2.8.x + Spring Boot 3.4.1 breaks native image support #2870

goafabric opened this issue Jan 21, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@goafabric
Copy link

goafabric commented Jan 21, 2025

Latest Spring Doc + Spring Boot 3.4.1 breaks the native image support.
Accessing OpenAPI will bail out with an error 400.

The following Reflection hints can at least get OpenAPI working Again:

@RegisterReflection(classes = {io.swagger.v3.core.jackson.mixin.Schema31Mixin.TypeSerializer.class, io.swagger.v3.oas.models.media.JsonSchema.class, com.fasterxml.jackson.databind.BeanDescription.class}, memberCategories = {MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS})

=>

I kindly ask to add them, as the latest org.graalvm.buildtools.native:0.10.4 does not seem to contain the reachability metadata.
It can also be done in other ways, as long as the classes above are registered for Reflection.

Thx in advance

@goafabric
Copy link
Author

add least for kotlin projects more reflection problems arised,
for now the could be mitigated by setting

springdoc:
enable-kotlin: false

@bnasslahsen
Copy link
Collaborator

@goafabric,

I have added a fix for it.
If you can also validate on your end, that would be great.

@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 25, 2025
@goafabric
Copy link
Author

thank you

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

No branches or pull requests

2 participants