You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,11 +41,11 @@ and then you are ready to send a pull request.
41
41
In some cases the error you want to report is not about "if a given json is valid against a schema", but instead an inproper validation failure report to be tested. In such case you can create a testcase which contains:
42
42
* a `schema.json`
43
43
* a `subject-invalid.json`
44
-
* an `expectedException.json`
44
+
* an `expected-exception.json`
45
45
46
46
The last one should contain a JSON description of the expected exception. Such an exception description has at most 2 keys:
47
47
*`message`: (required) the value is the expected exception message
48
-
*`causingExceptions` : (optional) the value is an array of causing exceptions (which are returned by the `ġetCausingExceptions()` method of the expected `ValidationException`). Each item of this entry should also be an exception description, so these are objects with a required `message` and an optional `causingExceptions` key. Example `expectedException.json`:
48
+
*`causingExceptions` : (optional) the value is an array of causing exceptions (which are returned by the `ġetCausingExceptions()` method of the expected `ValidationException`). Each item of this entry should also be an exception description, so these are objects with a required `message` and an optional `causingExceptions` key. Example `expected-exception.json`:
49
49
50
50
```js
51
51
{
@@ -72,6 +72,25 @@ The last one should contain a JSON description of the expected exception. Such a
72
72
}
73
73
```
74
74
75
+
### Setting validator configuration for integration tests
76
+
77
+
Aside the above listed files you can also specify a `validator-config.json` file containing information for the testrunner
78
+
about how to configure the loader and validator objects while running your test. In most cases you will be fine with the
79
+
defaults but in some cases you might need to change defaults. This can contain the following keys (all
80
+
of them are optional):
81
+
82
+
`validator-config.json` reference:
83
+
*`"failEarly"` (boolean): if set to `true` the validator will run in early failing mode (`false` by default)
84
+
*`"resolutionScope"` : sets the initial resolution scope (implicit top-level `"$id"`)
85
+
*`"regexpImplementation"`: if set to `"RE2J"` the validator will use the [RE2J](https://github.com/google/re2j) -based
86
+
regexp implementation (otherwise the default `java.util.regex` package is used.
87
+
*`"customFormats"` : a json object, each key is a format name, and the value is the fully qualified name of a format class
88
+
(implementing `org.everit.json.schema.FormatValidator`) you need to use in your testcase. The class must have a default
89
+
constructor. If you utilize this setting then you will also have to include the format class in your PR so that the testrunner
90
+
can instantiate it.
91
+
*`"metaSchemaVersion"`: can be `4` or `6` or `7`. Setting it to `6` or `7` enables draft-6 and draft-7 support respectively.
92
+
93
+
75
94
## Building the project locally
76
95
77
96
Prerequisities: the following tools have to be installed:
0 commit comments