Skip to content

Commit a199ac6

Browse files
committed
#604 add disabled test case to reproduce the NPE
1 parent dcd6749 commit a199ac6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.networknt.schema;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import org.junit.jupiter.api.Disabled;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
8+
9+
public class Issue604Test {
10+
@Test
11+
@Disabled("This test is disabled until the issue is fixed")
12+
public void failure() {
13+
SchemaValidatorsConfig config = new SchemaValidatorsConfig();
14+
config.setApplyDefaultsStrategy(new ApplyDefaultsStrategy(true, false, false));
15+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
16+
JsonSchema schema = factory.getSchema("{ \"type\": \"object\", \"properties\": { \"foo\": { \"type\": \"object\", \"properties\": { \"bar\": { \"type\": \"boolean\", \"default\": false } } } } }", config);
17+
ObjectMapper objectMapper = new ObjectMapper();
18+
assertDoesNotThrow(() -> {
19+
schema.walk(objectMapper.readTree("{}"), false);
20+
});
21+
}
22+
23+
}

0 commit comments

Comments
 (0)