Skip to content

Commit c654edb

Browse files
authored
Merge pull request #22 from aboutbits/add_support_for_non_record_types
hotfix type detection
2 parents 7512967 + 13a45a3 commit c654edb

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/main/java/it/aboutbits/springboot/toolbox/swagger/type/CustomTypePropertyCustomizer.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ public Schema<?> customize(Schema property, AnnotatedType annotatedType) {
3333
}
3434

3535
if (CustomType.class.isAssignableFrom(rawClass)) {
36-
@SuppressWarnings("unchecked")
37-
var wrappedType = CustomTypeReflectionUtil.getWrappedType(
38-
(Class<? extends CustomType<?>>) rawClass
39-
);
36+
Class<?> wrappedType = null;
37+
if (rawClass.equals(EntityId.class)) {
38+
wrappedType = simpleType.getBindings()
39+
.getTypeParameters()
40+
.getFirst()
41+
.getRawClass();
42+
} else {
43+
wrappedType = CustomTypeReflectionUtil.getWrappedType(
44+
(Class<? extends CustomType<?>>) rawClass
45+
);
46+
}
4047

4148
var isIdentity = EntityId.class.isAssignableFrom(rawClass);
4249

0 commit comments

Comments
 (0)