Skip to content

Add Support for Spring Native 0.11 #1376

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

Closed
goafabric opened this issue Dec 10, 2021 · 5 comments
Closed

Add Support for Spring Native 0.11 #1376

goafabric opened this issue Dec 10, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@goafabric
Copy link

Is your feature request related to a problem? Please describe.
SpringDoc OpenApi is currently the only Project that Supports Spring Native, thx for the effort.
As everything works finde with Native 0.10.5,
in native 0.11.0 support is broken.
Which might be no wonder, because there seem to be a lot of changes behind the curtain

** Problem **
Complete Build and Boostrap report here (don't know how long github will keep them)
https://github.com/goafabric/callee-service/runs/4481748956?check_suite_focus=true

Errors:

  • java.lang.IllegalStateException: Invalid mapping on handler class [org.springdoc.webmvc.api.OpenApiWebMvcResource]: public java.lang.String
  • org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'org.springdoc.core.Constants'

Describe the solution you'd like
Support for Sprint native 0.11

Additional context
What I already observed from native 0.11.0 is that name Inference from Requestsparams etc is not working any more.
And ConditonalProperties are resolved during build time .. don't know if this is relevant here .. just fyi

@bnasslahsen
Copy link
Collaborator

@goafabric,

I don't see the following dependency in your project.

<dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-native</artifactId>
      <version>1.5.13</version>
   </dependency>

This had to be a separate dependency, as spring-native 0.11 is only compatible with java 11 and higher (which is not the case for sprindoc-openapi which supports java 8 or higher)

Can you confirm if you are still having the same error even with this dependency?

@goafabric
Copy link
Author

Thx for the fast reply .. sadly it does not work at all,
but i may know why because I was fighting with the some issue now for the last 2 hours.
There is a breaking Change with the TypeHints in the final Release.
AccessBits which is used here is deprecated,
instead it's replaced by the ENUM TypeAccess.

On Top of that, you should NOT rely on the Default "AUTO_DETECT" from this guy ...
I had to change all my Typehints to:

access = {TypeAccess.DECLARED_CLASSES, TypeAccess.DECLARED_CONSTRUCTORS, TypeAccess.DECLARED_METHODS, TypeAccess.DECLARED_FIELDS})

Which might be a little verbose, but at least got it working ...

One questions concerning the dependency above:
Is this than a replacement for "springdoc-openapi-ui" ? Or an additional dependency ?
=> TO be clear i tried both ....

thx again

-- cut ---
java.lang.IllegalStateException: Attribute 'access' in annotation org.springframework.nativex.hint.TypeHint should be compatible with [Lorg.springframework.nativex.hint.TypeAccess; but a [Ljava.lang.Integer; value was returned
at org.springframework.core.annotation.TypeMappedAnnotation.adaptForAttribute(TypeMappedAnnotation.java:500) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.annotation.TypeMappedAnnotation.adaptForAttribute(TypeMappedAnnotation.java:475) ~[spring-core-5.3.13.jar:5.3.13]

@goafabric
Copy link
Author

To be honest .. i just checked native-11-RC1 .. this change was nowhere to be seen there,
so they introduced this afterwards .. which is honestly kindly baffling to me ... so I don't see a change for any of us to see that coming

@bnasslahsen
Copy link
Collaborator

@goafabric,

Thanks for your tip. Will look at it very soon!

@goafabric
Copy link
Author

@goafabric,

Thanks for your tip. Will look at it very soon!

thank you for your great support

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 9, 2022
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants