Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -696,7 +697,11 @@ public static Optional<Schema> getSchemaFromAnnotation(
schemaObject.set$ref(schema.ref());
}
if (StringUtils.isNotBlank(schema.type())) {
schemaObject.setType(schema.type());
if (openapi31 && Void.class.equals(schema.implementation())) {
schemaObject.setTypes(new LinkedHashSet<>(Collections.singleton(schema.type())));
} else if (!openapi31) {
schemaObject.setType(schema.type());
}
}

if (schema.types().length > 0) {
Expand Down Expand Up @@ -3126,7 +3131,10 @@ public static AnnotatedType addTypeWhenSiblingsAllowed(AnnotatedType aType, io.s
if (!Void.class.equals(ctxSchema.implementation())) {
aType.setType(ctxSchema.implementation());
} else if (StringUtils.isNotBlank(ctxSchema.type())) {
aType.setType(ctxSchema.type().getClass());
Type schemaType = getSchemaType(ctxSchema, true);
if (schemaType != null) {
aType.setType(schemaType);
}
}
}
return aType;
Expand Down
Loading
Loading