Skip to content

Commit b76c9f4

Browse files
authored
fixes #933 update javadoc and a test case (#934)
1 parent 7f1ec11 commit b76c9f4

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class AbsoluteIri {
3131
/**
3232
* Constructs a new IRI given the value.
3333
*
34-
* @param value
34+
* @param value String
3535
*/
3636
public AbsoluteIri(String value) {
3737
this.value = value;

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

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class Annotations {
6464
* Gets the default annotation allow list.
6565
*
6666
* @param metaSchema the meta schema
67+
* @return the default annotation allow set
6768
*/
6869
public static Set<String> getDefaultAnnotationAllowList(JsonMetaSchema metaSchema) {
6970
boolean unevaluatedProperties = metaSchema.getKeywords().get("unevaluatedProperties") != null;
@@ -82,6 +83,7 @@ public static Set<String> getDefaultAnnotationAllowList(JsonMetaSchema metaSchem
8283
* Gets the default annotation allow list predicate.
8384
*
8485
* @param metaSchema the meta schema
86+
* @return the default annotation allow list predicate
8587
*/
8688
public static Predicate<String> getDefaultAnnotationAllowListPredicate(JsonMetaSchema metaSchema) {
8789
boolean unevaluatedProperties = metaSchema.getKeywords().get("unevaluatedProperties") != null;

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ default void customize(ExecutionContext executionContext, ValidationContext vali
3737
/**
3838
* Formats the validation results.
3939
*
40-
* @param validationMessages
41-
* @param executionContext
40+
* @param validationMessages the validation messages
41+
* @param executionContext the execution context
42+
* @param validationContext the validation context
4243
* @return the result
4344
*/
4445
T format(Set<ValidationMessage> validationMessages, ExecutionContext executionContext,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static class Fragment {
188188
/**
189189
* Parses a string representing a fragment.
190190
*
191-
* @param fragmentString
191+
* @param fragmentString the fragment
192192
* @return the path
193193
*/
194194
public static JsonNodePath of(String fragmentString) {

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

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public static VersionFlag detect(JsonNode jsonNode) {
6868
* Optional} value, otherwise - returns the detected spec version wrapped into {@link Optional}.
6969
*
7070
* @param jsonNode JSON Node to read from
71+
* @param throwIfUnsupported whether to throw an exception if the version is not supported
7172
* @return Spec version if present, otherwise empty
7273
*/
7374
public static Optional<VersionFlag> detectOptionalVersion(JsonNode jsonNode, boolean throwIfUnsupported) {

src/main/java/com/networknt/schema/resource/InputStreamSource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface InputStreamSource {
2727
* Opens a new inputstream to the resource.
2828
*
2929
* @return a new inputstream
30-
* @throws IOException
30+
* @throws IOException if an I/O error occurs
3131
*/
3232
InputStream getInputStream() throws IOException;
3333
}

src/test/java/com/networknt/schema/Issue619Test.java

+7
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ public void uriThatPointsToNodeThatDoesNotExistShouldFail_Ref() {
154154

155155
@Test
156156
public void uriThatPointsToNodeThatDoesNotExistShouldFail_Uri() {
157+
// This test failed before adding the 10-millisecond sleep. IllegalStateException is returned with recursive update error. This only happens on my faster desktop
158+
// computer during 'maven clean install'. It passes within the IDE on the same computer. It passes on my slower laptop. It passes on Travis CI.
159+
try {
160+
Thread.sleep(10);
161+
} catch (InterruptedException e) {
162+
e.printStackTrace();
163+
}
157164
assertThrows(JsonSchemaException.class, () -> factory.getSchema(SchemaLocation.of("resource:schema/issue619.json#/definitions/node-that-does-not-exist")));
158165
}
159166
}

0 commit comments

Comments
 (0)