Skip to content

Commit

Permalink
EPMRPP-89662 || Combine if
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski committed Mar 15, 2024
1 parent 2b356ee commit 04ac327
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,18 @@ public ModelConverter iterableModelConverter() {
public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context,
Iterator<ModelConverter> chain) {
JavaType javaType = Json.mapper().constructType(annotatedType.getType());
if (javaType != null) {
if (Iterable.class.equals(javaType.getRawClass())) {
annotatedType = new AnnotatedType()
.type(javaType.containedType(0))
.ctxAnnotations(annotatedType.getCtxAnnotations())
.parent(annotatedType.getParent())
.schemaProperty(annotatedType.isSchemaProperty())
.name(annotatedType.getName())
.resolveAsRef(annotatedType.isResolveAsRef())
.jsonViewAnnotation(annotatedType.getJsonViewAnnotation())
.propertyName(annotatedType.getPropertyName())
.skipOverride(true);
return new ArraySchema().items(this.resolve(annotatedType, context, chain));
}
if (javaType != null && Iterable.class.equals(javaType.getRawClass())) {
annotatedType = new AnnotatedType()
.type(javaType.containedType(0))
.ctxAnnotations(annotatedType.getCtxAnnotations())
.parent(annotatedType.getParent())
.schemaProperty(annotatedType.isSchemaProperty())
.name(annotatedType.getName())
.resolveAsRef(annotatedType.isResolveAsRef())
.jsonViewAnnotation(annotatedType.getJsonViewAnnotation())
.propertyName(annotatedType.getPropertyName())
.skipOverride(true);
return new ArraySchema().items(this.resolve(annotatedType, context, chain));
}
return (chain.hasNext()) ? chain.next().resolve(annotatedType, context, chain) : null;
}
Expand Down

0 comments on commit 04ac327

Please sign in to comment.