Skip to content

Commit 3b21a47

Browse files
committed
Fixes #183 Validation error when field is nullable and consumer sends in a null value
1 parent 6d52a9b commit 3b21a47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/com/networknt/schema/EnumValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public EnumValidator(String schemaPath, JsonNode schemaNode, JsonSchema parentSc
5252
}
5353

5454
// check if the parent schema declares the fields as nullable
55-
if(config.getHandleNullableField()) {
55+
if(config.isHandleNullableField()) {
5656
JsonNode nullable = parentSchema.getSchemaNode().get("nullable");
5757
if (nullable != null && nullable.asBoolean()) {
5858
nodes.add(NullNode.getInstance());

src/main/java/com/networknt/schema/SchemaValidatorsConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void setMissingNodeAsError(boolean missingNodeAsError) {
7373
this.missingNodeAsError = missingNodeAsError;
7474
}
7575

76-
public boolean getHandleNullableField() {
76+
public boolean isHandleNullableField() {
7777
return handleNullableField;
7878
}
7979

0 commit comments

Comments
 (0)