Skip to content

Commit 13a45a3

Browse files
committed
hotfix type detection
1 parent cb7c9b9 commit 13a45a3

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)