manuelrazola commented on a change in pull request #72:
URL: https://github.com/apache/johnzon/pull/72#discussion_r535008028
##########
File path:
johnzon-jsonschema/src/test/java/org/apache/johnzon/jsonschema/JsonSchemaValidatorTest.java
##########
@@ -355,6 +355,25 @@ public void exclusiveMaximum() {
validator.close();
}
+
+ @Test
+ public void integerType() {
+ final JsonSchemaValidator validator =
factory.newInstance(jsonFactory.createObjectBuilder()
+ .add("type", "object")
+ .add("properties", jsonFactory.createObjectBuilder()
+ .add("age", jsonFactory.createObjectBuilder()
+ .add("type", "integer")
+ .build())
+ .build())
+ .build());
+
+
assertTrue(validator.apply(jsonFactory.createObjectBuilder().build()).isSuccess());
+
assertTrue(validator.apply(jsonFactory.createObjectBuilder().add("age",
30).build()).isSuccess());
+ // check no decimal numbers allowed
+ assertFalse(validator.apply(jsonFactory.createObjectBuilder()
.add("age", 30.3) .build()).isSuccess());
Review comment:
Updated tests
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]