File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
tests/src/test/resources/org/everit/json/schema/issues/issue38 Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
* [ Maven installation] ( #maven-installation )
5
5
* [ Quickstart] ( #quickstart )
6
6
* [ Investigating failures] ( #investigating-failures )
7
+ * [ JSON report of the failures] ( #json-report-of-the-failures )
7
8
* [ Format validators] ( #format-validators )
8
9
* [ Example] ( #example )
9
10
* [ Resolution scopes] ( #resolution-scopes )
@@ -143,7 +144,18 @@ This will print the following output:
143
144
#/rectangle/a: -5.0 is not higher or equal to 0
144
145
#/rectangle/b: expected type: Number, found: String
145
146
```
146
-
147
+ ### JSON report of the failures
148
+
149
+ Since version ` 1.4.0 ` it is possible to print the ` ValidationException ` instances as
150
+ JSON-formatted failure reports. The ` ValidationException#toJSON() ` method returns a ` JSONObject ` instance with the
151
+ following keys:
152
+
153
+ * ` "message" ` : the programmer-friendly exception message (desription of the validation failure)
154
+ * ` "keyword" ` : the JSON Schema keyword which was violated
155
+ * ` "pointerToViolation" ` : a JSON Pointer denoting the path from the input document root to its fragment which caused
156
+ the validation failure
157
+ * ` "causingExceptions" ` : a (possibly empty) array of sub-exceptions. Each sub-exception is represented as a JSON object,
158
+ with the same structure as described in this listing. See more above about causing exceptions.
147
159
148
160
149
161
## Format validators
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments