Skip to content

Commit

Permalink
Spec for @ParameterObject disappears if building native-images. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Aug 6, 2023
1 parent 19555d1 commit 41e00a5
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
*/
public class SpringDocHints implements RuntimeHintsRegistrar {

//swagger-models
static Class[] swaggerModels = {
static Class[] typesToRegister = {
//swagger-models
io.swagger.v3.oas.models.security.SecurityScheme.Type.class,
io.swagger.v3.oas.models.security.SecurityScheme.In.class,
io.swagger.v3.oas.models.media.Encoding.class,
Expand Down Expand Up @@ -159,6 +159,12 @@ public class SpringDocHints implements RuntimeHintsRegistrar {
DateSchemaMixin.class,
ExampleMixin.class,
MediaTypeMixin.class,
//springdoc classes
org.springdoc.core.annotations.ParameterObject.class,
org.springdoc.core.converters.models.Pageable.class,
org.springdoc.core.extractor.DelegatingMethodParameter.class,
// spring
org.springframework.core.MethodParameter.class
};

@Override
Expand All @@ -174,7 +180,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
.registerType(java.lang.module.Configuration.class, MemberCategory.INVOKE_DECLARED_METHODS)
.registerType(java.lang.module.ResolvedModule.class, MemberCategory.INVOKE_DECLARED_METHODS);
//swagger-models
Arrays.stream(swaggerModels).forEach(aClass ->
Arrays.stream(typesToRegister).forEach(aClass ->
hints.reflection().registerType(aClass,
hint -> hint.withMembers(
MemberCategory.DECLARED_FIELDS,
Expand Down

0 comments on commit 41e00a5

Please sign in to comment.