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
- fixes #666 Clarify usage of Apache commons lang in README.md. Thanks @loadedice
418
427
- fixes #663 Use full schema path to look up type validators for anyOf operator. Thanks @pshevche
@@ -617,7 +626,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
617
626
618
627
### Changed
619
628
620
-
- fixes #456 OneOf only validate the first sub schema. This was a defect introduced in 1.0.58 and everyone should upgrade to 1.0.62 if you are using 1.0.58 to 1.0.61.
629
+
- fixes #456 OneOf only validate the first sub schema. This was a defect introduced in 1.0.58 and everyone should upgrade to 1.0.62 if you are using 1.0.58 to 1.0.61.
621
630
622
631
## 1.0.61 - 2021-10-09
623
632
@@ -647,7 +656,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
647
656
## 1.0.58 - 2021-08-23
648
657
649
658
### Added
650
-
-
659
+
-
651
660
- fixes #439 add i18n support for ValidationMessage. Thanks @leaves615
652
661
- fixes #438 Adding custom message support in the schema. Thanks @adilath18
653
662
@@ -732,7 +741,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
732
741
- fixes #387 Resolve the test case errors for TypeFactoryTest
733
742
- fixes #385 Fixing concurrency and compilation issues. Thanks @prashanthjos
Copy file name to clipboardExpand all lines: README.md
+22-25
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The [Releases](https://github.com/networknt/json-schema-validator/releases) page
40
40
41
41
## Comparing against other implementations
42
42
43
-
The [JSON Schema Validation Comparison](https://github.com/creek-service/json-schema-validation-comparison) project from Creek has an informative [Comparison of JVM based Schema Validation Implementations](https://www.creekservice.org/json-schema-validation-comparison/) which compares both the functional and performance characteristics of a number of different Java implementations.
43
+
The [JSON Schema Validation Comparison](https://github.com/creek-service/json-schema-validation-comparison) project from Creek has an informative [Comparison of JVM based Schema Validation Implementations](https://www.creekservice.org/json-schema-validation-comparison/) which compares both the functional and performance characteristics of a number of different Java implementations.
@@ -94,19 +94,19 @@ This implementation is tested against the [JSON Schema Test Suite](https://githu
94
94
95
95
#### Jackson Parser
96
96
97
-
This library uses [Jackson](https://github.com/FasterXML/jackson) which is a Java JSON parser that is widely used in other projects. If you are already using the Jackson parser in your project, it is natural to choose this library over others for schema validation.
97
+
This library uses [Jackson](https://github.com/FasterXML/jackson) which is a Java JSON parser that is widely used in other projects. If you are already using the Jackson parser in your project, it is natural to choose this library over others for schema validation.
98
98
99
99
#### YAML Support
100
100
101
-
The library works with JSON and YAML on both schema definitions and input data.
101
+
The library works with JSON and YAML on both schema definitions and input data.
102
102
103
103
#### OpenAPI Support
104
104
105
-
The OpenAPI 3.0 specification is using JSON schema to validate the request/response, but there are some differences. With a configuration file, you can enable the library to work with OpenAPI 3.0 validation.
105
+
The OpenAPI 3.0 specification is using JSON schema to validate the request/response, but there are some differences. With a configuration file, you can enable the library to work with OpenAPI 3.0 validation.
106
106
107
107
#### Minimal Dependencies
108
108
109
-
Following the design principle of the Light Platform, this library has minimal dependencies to ensure there are no dependency conflicts when using it.
109
+
Following the design principle of the Light Platform, this library has minimal dependencies to ensure there are no dependency conflicts when using it.
110
110
111
111
##### Required Dependencies
112
112
@@ -204,7 +204,7 @@ The Ethlo Time dependency can be excluded if accurate validation of the `date-ti
204
204
205
205
#### Community
206
206
207
-
This library is very active with a lot of contributors. New features and bug fixes are handled quickly by the team members. Because it is an essential dependency of the [light-4j](https://github.com/networknt/light-4j) framework in the same GitHub organization, it will be evolved and maintained along with the framework.
207
+
This library is very active with a lot of contributors. New features and bug fixes are handled quickly by the team members. Because it is an essential dependency of the [light-4j](https://github.com/networknt/light-4j) framework in the same GitHub organization, it will be evolved and maintained along with the framework.
208
208
209
209
## Prerequisite
210
210
@@ -214,31 +214,31 @@ The library supports Java 8 and up. If you want to build from the source code, y
The following example demonstrates how inputs are validated against a schema. It comprises the following steps.
240
240
241
-
* Creating a schema factory with the default schema dialect and how the schemas can be retrieved.
241
+
* Creating a schema factory with the default schema dialect and how the schemas can be retrieved.
242
242
* Configuring mapping the `$id` to a retrieval URI using `schemaMappers`.
243
243
* Configuring how the schemas are loaded using the retrieval URI using `schemaLoaders`.
244
244
For instance a `Map<String, String> schemas` containing a mapping of retrieval URI to schema data as a `String` can by configured using `builder.schemaLoaders(schemaLoaders -> schemaLoaders.schemas(schemas))`. This also accepts a `Function<String, String> schemaRetrievalFunction`.
@@ -250,7 +250,7 @@ The following example demonstrates how inputs are validated against a schema. It
250
250
// This creates a schema factory that will use Draft 2020-12 as the default if $schema is not specified
251
251
// in the schema data. If $schema is specified in the schema data then that schema dialect will be used
The following types of results are generated by the library.
321
321
322
-
| Type | Description
322
+
| Type | Description
323
323
|-------------|-------------------
324
324
| Assertions | Validation errors generated by a keyword on a particular input data instance. This is generally described in a `ValidationMessage` or in a `OutputUnit`. Note that since Draft 2019-09 the `format` keyword no longer generates assertions by default and instead generates only annotations unless configured otherwise using a configuration option or by using a meta-schema that uses the appropriate vocabulary.
325
325
| Annotations | Additional information generated by a keyword for a particular input data instance. This is generally described in a `OutputUnit`. Annotation collection and reporting is turned off by default. Annotations required by keywords such as `unevaluatedProperties` or `unevaluatedItems` are always collected for evaluation purposes and cannot be disabled but will not be reported unless configured to do so.
326
326
327
327
The following information is used to describe both types of results.
328
328
329
-
| Type | Description
329
+
| Type | Description
330
330
|-------------------|-------------------
331
331
| Evaluation Path | This is the set of keys from the root through which evaluation passes to reach the schema for evaluating the instance. This includes `$ref` and `$dynamicRef`. eg. ```/properties/bar/$ref/properties/bar-prop```
332
332
| Schema Location | This is the canonical IRI of the schema plus the JSON pointer fragment to the schema that was used for evaluating the instance. eg. ```https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop```
333
333
| Instance Location | This is the JSON pointer fragment to the instance data that was being evaluated. eg. ```/bar/bar-prop```
334
334
335
335
Assertions contains the following additional information
336
336
337
-
| Type | Description
337
+
| Type | Description
338
338
|-------------------|-------------------
339
339
| Message | The validation error message.
340
340
| Code | The error code.
@@ -349,7 +349,7 @@ Assertions contains the following additional information
349
349
350
350
Annotations contains the following additional information
351
351
352
-
| Type | Description
352
+
| Type | Description
353
353
|-------------------|-------------------
354
354
| Value | The annotation value generated
355
355
@@ -411,7 +411,7 @@ This library implements the Flag, List and Hierarchical output formats defined i
411
411
412
412
The List and Hierarchical output formats are particularly helpful for understanding how the system arrived at a particular result.
413
413
414
-
| Output Format | Description
414
+
| Output Format | Description
415
415
|-------------------|-------------------
416
416
| Default | Generates the list of assertions.
417
417
| Boolean | Returns `true` if the validation is successful. Note that the fail fast option is turned on by default for this output format.
@@ -425,7 +425,7 @@ The following example shows how to generate the hierarchical output format with
@@ -533,7 +533,7 @@ The following is sample output from the Hierarchical format.
533
533
| `readOnly` | Whether schema is read only. This affects the `readOnly` keyword. | `null`
534
534
| `regularExpressionFactory` | The factory to use to create regular expressions for instance `JoniRegularExpressionFactory` or `GraalJSRegularExpressionFactory`. This requires the dependency to be manually added to the project or a `ClassNotFoundException` will be thrown. | `JDKRegularExpressionFactory.getInstance()`
535
535
| `schemaIdValidator` | This is used to customize how the `$id` values are validated. Note that the default implementation allows non-empty fragments where no base IRI is specified and also allows non-absolute IRI `$id` values in the root schema. | `JsonSchemaIdValidator.DEFAULT`
536
-
|`strict`| This is set whether keywords are strict in their validation. What this does depends on the individual validators. |
536
+
|`strict`| This is set whether keywords are strict in their validation. What this does depends on the individual validators. |
537
537
| `typeLoose` | Whether types are interpreted in a loose manner. If set to true, a single value can be interpreted as a size 1 array. Strings may also be interpreted as number, integer or boolean. | `false`
538
538
| `writeOnly` | Whether schema is write only. This affects the `writeOnly` keyword. | `null`
539
539
@@ -594,13 +594,13 @@ The library assumes that the schemas being loaded are trusted. This security mod
594
594
595
595
## Projects
596
596
597
-
The [light-rest-4j](https://github.com/networknt/light-rest-4j), [light-graphql-4j](https://github.com/networknt/light-graphql-4j) and [light-hybrid-4j](https://github.com/networknt/light-hybrid-4j) use this library to validate the request and response based on the specifications. If you are using other frameworks like Spring Boot, you can use the [OpenApiValidator](https://github.com/mservicetech/openapi-schema-validation), a generic OpenAPI 3.0 validator based on the OpenAPI 3.0 specification.
597
+
The [light-rest-4j](https://github.com/networknt/light-rest-4j), [light-graphql-4j](https://github.com/networknt/light-graphql-4j) and [light-hybrid-4j](https://github.com/networknt/light-hybrid-4j) use this library to validate the request and response based on the specifications. If you are using other frameworks like Spring Boot, you can use the [OpenApiValidator](https://github.com/mservicetech/openapi-schema-validation), a generic OpenAPI 3.0 validator based on the OpenAPI 3.0 specification.
598
598
599
599
If you have a project using this library, please submit a PR to add your project below.
600
600
601
601
## Contributors
602
602
603
-
Thanks to the following people who have contributed to this project. If you are using this library, please consider to be a sponsor for one of the contributors.
603
+
Thanks to the following people who have contributed to this project. If you are using this library, please consider to be a sponsor for one of the contributors.
604
604
605
605
[@stevehu](https://github.com/sponsors/stevehu)
606
606
@@ -644,6 +644,3 @@ If you are a contributor, please join the [GitHub Sponsors](https://github.com/s
0 commit comments