File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
json-schema-validator/src/test/java/io/openapiprocessor/jsonschema/example Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 13
13
import org .junit .jupiter .api .Test ;
14
14
15
15
import java .net .URI ;
16
+ import java .util .Collection ;
16
17
17
18
import static io .openapiprocessor .jsonschema .support .Uris .createUri ;
18
19
@@ -81,10 +82,11 @@ void setupExample() throws ConverterException {
81
82
boolean valid = result .isValid ();
82
83
83
84
// 7. print errors with error location
84
- if (!valid && result .getErrors () != null ) {
85
+ Collection <OutputUnit > errors = result .getErrors ();
86
+ if (!valid && errors != null ) {
85
87
System .out .println ("validation failed!" );
86
88
87
- for (OutputUnit error : result . getErrors () ) {
89
+ for (OutputUnit error : errors ) {
88
90
String schemaLocation = error .getAbsoluteKeywordLocation ();
89
91
schemaLocation = schemaLocation .substring (schemaLocation .indexOf ('#' ));
90
92
@@ -98,4 +100,4 @@ void setupExample() throws ConverterException {
98
100
}
99
101
}
100
102
}
101
- }
103
+ }
You can’t perform that action at this time.
0 commit comments