@@ -4,7 +4,37 @@ Contributing guidelines
4
4
Submitting bugreports
5
5
---------------------
6
6
7
+ Though any kind of feedback, feature request and bugreport is appreciated, I would more prefer if you would send a proper
8
+ pull request with a failing test in case you find a bug in the library.
7
9
10
+ Currently there is a simple mechanism in the integration tests to make it easy to add new tests. Using this is especially
11
+ preferred if your bugreport is related to a complex schema or multiple schemas. There is no need to dig into the java code,
12
+ you only have to create a few new files in the repo (but you will have to run the tests - see the build instructions below).
13
+
14
+ Steps:
15
+ * create an issue, just to get an issue number
16
+ * fork the repository
17
+ * in your fork, create a directory under the ` tests/src/test/resources/org/everit/json/schema/issues/ ` directory (for example ` issue42 ` )
18
+ * in this directory create a ` schema.json ` file with your JSON Schema document that is not handled correctly
19
+ * in the same directory create a ` subject-valid.json ` file, which is a JSON document, and you expect that document to pass
20
+ the validation, but due to a bug it fails with a ` ValidationException `
21
+ * if you have a JSON document that you expect to be invalid, but it passes the validation, then you should name this file ` subject-invalid.json ` .
22
+ It will mean that for the test suite that an expected ValidationException is not thrown.
23
+ * you can create both the ` subject-valid.json ` and ` subject-invalid.json ` test files if you find it needed
24
+
25
+
26
+ Remote schema loading:
27
+ If your testcase has anything to do with remote schemas, then
28
+ * you can put those schemas under the ` yourIssueDir/remotes/ ` directory
29
+ * the ` yourIssueDir/remotes/ ` directory will act as the document root of a HTTP server during test execution
30
+ * this HTTP server will listen at address ` http://localhost:1234 ` so please change your schemas (` id ` and ` $ref ` properties)
31
+ to fetch the remote schemas relative from this address
32
+
33
+ You can find a good example for all of these in the ` tests/src/test/resources/org/everit/json/schema/issues/issue17 ` testcase.
34
+
35
+ If you successfully created your testcase, then it will fail with an ` AssertionError ` with a message like
36
+ "validation failed with: org.everit.json.schema.ValidationException:..." or "did not throw ValidationException for invalid subject",
37
+ and then you are ready to send a pull request.
8
38
9
39
10
40
Building the project locally
@@ -18,3 +48,5 @@ Prerequisities: the following tools have to be installed:
18
48
Steps for building the project:
19
49
* clone the repository: ` git clone https://github.com/everit-org/json-schema.git && cd json-schema/ `
20
50
* build it with maven: ` mvn clean install `
51
+
52
+ (or just ` mvn clean test ` if you are only interested in running the tests)
0 commit comments