Skip to content

Commit

Permalink
Add test with booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
gcatanese authored and frantuma committed Mar 28, 2022
1 parent f17b48c commit 0685b2c
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -704,4 +704,50 @@ public void setId(String id) {
}
}

@Test
public void testModelWithBoolean() {

String yaml = "ClassWithBoolean:\n" +
" required:\n" +
" - booleanObject\n" +
" - booleanType\n" +
" type: object\n" +
" properties:\n" +
" booleanObject:\n" +
" type: boolean\n" +
" description: my Boolean object field\n" +
" booleanType:\n" +
" type: boolean\n" +
" description: my boolean type field\n";
SerializationMatchers.assertEqualsToYaml(read(ClassWithBoolean.class), yaml);

}

@Schema
static class ClassWithBoolean {

@Schema(required = true, description = "my Boolean object field")
private Boolean booleanObject;

@Schema(required = true, description = "my boolean type field")
private boolean booleanType;

public Boolean getBooleanObject() {
return booleanObject;
}

public void setBooleanObject(Boolean booleanObject) {
this.booleanObject = booleanObject;
}

public boolean getBooleanType() {
return booleanType;
}

public void setBooleanType(boolean booleanType) {
this.booleanType = booleanType;
}
}


}

0 comments on commit 0685b2c

Please sign in to comment.