From 13a45a3b27fa54727cf4b841e04c355dc7a204cb Mon Sep 17 00:00:00 2001 From: Andreas Hufler Date: Thu, 3 Apr 2025 13:30:18 +0200 Subject: [PATCH] hotfix type detection --- .../type/CustomTypePropertyCustomizer.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/it/aboutbits/springboot/toolbox/swagger/type/CustomTypePropertyCustomizer.java b/src/main/java/it/aboutbits/springboot/toolbox/swagger/type/CustomTypePropertyCustomizer.java index 169e024..b0a492b 100644 --- a/src/main/java/it/aboutbits/springboot/toolbox/swagger/type/CustomTypePropertyCustomizer.java +++ b/src/main/java/it/aboutbits/springboot/toolbox/swagger/type/CustomTypePropertyCustomizer.java @@ -33,10 +33,17 @@ public Schema customize(Schema property, AnnotatedType annotatedType) { } if (CustomType.class.isAssignableFrom(rawClass)) { - @SuppressWarnings("unchecked") - var wrappedType = CustomTypeReflectionUtil.getWrappedType( - (Class>) rawClass - ); + Class wrappedType = null; + if (rawClass.equals(EntityId.class)) { + wrappedType = simpleType.getBindings() + .getTypeParameters() + .getFirst() + .getRawClass(); + } else { + wrappedType = CustomTypeReflectionUtil.getWrappedType( + (Class>) rawClass + ); + } var isIdentity = EntityId.class.isAssignableFrom(rawClass);