Skip to content

Commit 41e00a5

Browse files
committed
Spec for @ParameterObject disappears if building native-images. Fixes #2312
1 parent 19555d1 commit 41e00a5

File tree

1 file changed

+9
-3
lines changed
  • springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints

1 file changed

+9
-3
lines changed

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
*/
8787
public class SpringDocHints implements RuntimeHintsRegistrar {
8888

89-
//swagger-models
90-
static Class[] swaggerModels = {
89+
static Class[] typesToRegister = {
90+
//swagger-models
9191
io.swagger.v3.oas.models.security.SecurityScheme.Type.class,
9292
io.swagger.v3.oas.models.security.SecurityScheme.In.class,
9393
io.swagger.v3.oas.models.media.Encoding.class,
@@ -159,6 +159,12 @@ public class SpringDocHints implements RuntimeHintsRegistrar {
159159
DateSchemaMixin.class,
160160
ExampleMixin.class,
161161
MediaTypeMixin.class,
162+
//springdoc classes
163+
org.springdoc.core.annotations.ParameterObject.class,
164+
org.springdoc.core.converters.models.Pageable.class,
165+
org.springdoc.core.extractor.DelegatingMethodParameter.class,
166+
// spring
167+
org.springframework.core.MethodParameter.class
162168
};
163169

164170
@Override
@@ -174,7 +180,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
174180
.registerType(java.lang.module.Configuration.class, MemberCategory.INVOKE_DECLARED_METHODS)
175181
.registerType(java.lang.module.ResolvedModule.class, MemberCategory.INVOKE_DECLARED_METHODS);
176182
//swagger-models
177-
Arrays.stream(swaggerModels).forEach(aClass ->
183+
Arrays.stream(typesToRegister).forEach(aClass ->
178184
hints.reflection().registerType(aClass,
179185
hint -> hint.withMembers(
180186
MemberCategory.DECLARED_FIELDS,

0 commit comments

Comments
 (0)