Skip to content

Commit 0685b2c

Browse files
gcatanesefrantuma
authored andcommitted
Add test with booleans
1 parent f17b48c commit 0685b2c

File tree

1 file changed

+46
-0
lines changed
  • modules/swagger-core/src/test/java/io/swagger/v3/core/converting

1 file changed

+46
-0
lines changed

modules/swagger-core/src/test/java/io/swagger/v3/core/converting/PojoTest.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,4 +704,50 @@ public void setId(String id) {
704704
}
705705
}
706706

707+
@Test
708+
public void testModelWithBoolean() {
709+
710+
String yaml = "ClassWithBoolean:\n" +
711+
" required:\n" +
712+
" - booleanObject\n" +
713+
" - booleanType\n" +
714+
" type: object\n" +
715+
" properties:\n" +
716+
" booleanObject:\n" +
717+
" type: boolean\n" +
718+
" description: my Boolean object field\n" +
719+
" booleanType:\n" +
720+
" type: boolean\n" +
721+
" description: my boolean type field\n";
722+
SerializationMatchers.assertEqualsToYaml(read(ClassWithBoolean.class), yaml);
723+
724+
}
725+
726+
@Schema
727+
static class ClassWithBoolean {
728+
729+
@Schema(required = true, description = "my Boolean object field")
730+
private Boolean booleanObject;
731+
732+
@Schema(required = true, description = "my boolean type field")
733+
private boolean booleanType;
734+
735+
public Boolean getBooleanObject() {
736+
return booleanObject;
737+
}
738+
739+
public void setBooleanObject(Boolean booleanObject) {
740+
this.booleanObject = booleanObject;
741+
}
742+
743+
public boolean getBooleanType() {
744+
return booleanType;
745+
}
746+
747+
public void setBooleanType(boolean booleanType) {
748+
this.booleanType = booleanType;
749+
}
750+
}
751+
752+
707753
}

0 commit comments

Comments
 (0)