Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
micryc committed Aug 22, 2024
1 parent f47df4d commit 610cd4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
!(a instanceof io.swagger.v3.oas.annotations.media.ArraySchema)) {
ctxAnnotations31List.add(a);
}
if ((ctxSchema != null) && (!ctxSchema.implementation().equals(Void.class) || StringUtils.isNotEmpty(ctxSchema.type()))) {
if ((ctxSchema != null) && (!ctxSchema.implementation().equals(Void.class) || StringUtils.isNotEmpty(ctxSchema.type()))) {
ctxAnnotations31List.add(a);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Map;

public class Ticket4679Test extends SwaggerTestBase{

@Test(description = "Custom schema implementation in property overrides type value")
public void testCustomSchemaImplementation() {

Expand All @@ -23,7 +24,6 @@ public void testCustomSchemaImplementation() {

Map<String, io.swagger.v3.oas.models.media.Schema> stringSchemaMap = ModelConverters.getInstance(true).readAll(ModelWithCustomSchemaImplementationInProperty.class);
SerializationMatchers.assertEqualsToYaml31(stringSchemaMap, expectedYaml);
System.out.println(Yaml31.pretty(stringSchemaMap));
}

static class ModelWithCustomSchemaImplementationInProperty {
Expand All @@ -41,6 +41,7 @@ public String getExampleField() {
public void setExampleField(String exampleField) {
this.exampleField = exampleField;
}

public Integer getSecondExampleField() {
return secondExampleField;
}
Expand Down

0 comments on commit 610cd4b

Please sign in to comment.