Skip to content

Commit 4e8a2b8

Browse files
committed
upgrade to 1.5.5 and update changelog
1 parent 4b1b7b4 commit 4e8a2b8

File tree

3 files changed

+45
-39
lines changed

3 files changed

+45
-39
lines changed

CHANGELOG.md

+22-13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ This project does not adhere to [Semantic Versioning](https://semver.org/) and m
1111

1212
### Changed
1313

14+
## 1.5.5 - 2025-01-14
15+
16+
### Added
17+
18+
### Changed
19+
20+
- Fix custom error message for union type (#1138) Thanks @justin-tay
21+
- Update itu 1.10.2 -> 1.10.3 (#1143) Thanks @MelvinFrohike
22+
1423
## 1.5.4 - 2024-11-24
1524

1625
### Added
@@ -104,7 +113,7 @@ This project does not adhere to [Semantic Versioning](https://semver.org/) and m
104113
- Deprecate config to disable unevaluatedItems and unevaluatedProperties evaluation as no longer needed (#1059) Thanks @justin-tay
105114
- Add GraalJS regular expression and factory implementation (#1058) Thanks @justin-tay
106115
- Allow customization of const message to include input value (#1057) Thanks @justin-tay
107-
- Optimize logging by creating a debug flag (#1054) Thanks @justin-tay
116+
- Optimize logging by creating a debug flag (#1054) Thanks @justin-tay
108117
- Release delegate held by cached supplier (#1056) Thanks @justin-tay
109118
- Remove incorrect logic for oneOf, anyOf and properties (#1053) Thanks @justin-tay
110119
- Detect invalid escape for ecmascript (#1049) Thanks @justin-tay
@@ -232,7 +241,7 @@ With #915 and #922 implemented, it breaks the API. Users code might need to chan
232241
### Changed
233242

234243
- fixes #906 Cannot load JSON schemas with URN value in id field. Thanks @martin-sladecek
235-
- upgrade logback to 1.4.14
244+
- upgrade logback to 1.4.14
236245
- fixes #896 Refactor to remove ThreadLocal usage. Thanks @justin-tay
237246
- upgrade slf4j to 2.0.9
238247
- fixes #900 compile configuration is depricated. Thanks @saurvkmr
@@ -245,11 +254,11 @@ With #915 and #922 implemented, it breaks the API. Users code might need to chan
245254
- fixes #886 Fix invalid class passed to getLogger. Thanks @brempusz
246255
- upgrade jackson to 2.15.3
247256
- fixes #883 docs clarify commons-lang3 exclusion only required for 1.0.81. Thanks @JonasGroeger
248-
- fixes #866 Fix identation in example in walkers.md. Thanks @bpaquet
257+
- fixes #866 Fix identation in example in walkers.md. Thanks @bpaquet
249258

250259
### Upgrade Guide
251260

252-
With #896 implemented, it breaks the API. Users code might need to change in order to move to this version.
261+
With #896 implemented, it breaks the API. Users code might need to change in order to move to this version.
253262

254263

255264
## 1.0.87 - 2023-09-08
@@ -272,7 +281,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
272281
### Changed
273282

274283
- fixes #827 Stops unevaluatedProperties and unevaluatedItems being applied recursively. Thanks @aznan2
275-
- fixes #834 Always normalize uri keys of JsonSchemaFactory.jsonMetaSchemas on both read and write. Thanks @stacywsmith
284+
- fixes #834 Always normalize uri keys of JsonSchemaFactory.jsonMetaSchemas on both read and write. Thanks @stacywsmith
276285

277286

278287
## 1.0.85 - 2023-06-22
@@ -354,7 +363,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
354363

355364
- fixes #731 Improves performance. Thanks @fdutton
356365
- fixes #730 Removes need for network access when executing unit-tests. Thanks @fdutton
357-
- fixes #728 Adds explicit Java module descriptor for JDK9+. Thanks @aalmiray
366+
- fixes #728 Adds explicit Java module descriptor for JDK9+. Thanks @aalmiray
358367
- fixes #725 custom uri fetcher doc. Thanks @michapojo
359368
- update the contributors and sponsors
360369
- fixes #720 Produces validation messages when oneOf has no valid schemas. Thanks @fdutton
@@ -412,7 +421,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
412421
### Changed
413422

414423
- update the README.md to indicate that 202012 version is only partially supported.
415-
- fixes #668 handle references to yaml sub-schemas. Thanks @danfelicetta-RL
424+
- fixes #668 handle references to yaml sub-schemas. Thanks @danfelicetta-RL
416425
- fixes #664 Provide/unify schema path for applicator schemas. Thanks @htdan
417426
- fixes #666 Clarify usage of Apache commons lang in README.md. Thanks @loadedice
418427
- 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
617626

618627
### Changed
619628

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.
621630

622631
## 1.0.61 - 2021-10-09
623632

@@ -647,7 +656,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
647656
## 1.0.58 - 2021-08-23
648657

649658
### Added
650-
-
659+
-
651660
- fixes #439 add i18n support for ValidationMessage. Thanks @leaves615
652661
- fixes #438 Adding custom message support in the schema. Thanks @adilath18
653662

@@ -732,7 +741,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
732741
- fixes #387 Resolve the test case errors for TypeFactoryTest
733742
- fixes #385 Fixing concurrency and compilation issues. Thanks @prashanthjos
734743
- fixes #383 Nested oneOf gives incorrect validation error. Thanks @JonasProgrammer
735-
- fixes #379 Add lossless narrowing convertion. Thanks @hkupty
744+
- fixes #379 Add lossless narrowing convertion. Thanks @hkupty
736745
- fixes #378 Upgrade Jackson to 2.12.1 and Undertow to 2.2.4.Final
737746

738747
## 1.0.49 - 2021-02-17
@@ -930,7 +939,7 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
930939

931940
### Changed
932941

933-
- Update description in pom.xml to match readme.md. Thanks @reftel
942+
- Update description in pom.xml to match readme.md. Thanks @reftel
934943
- fixes #232 update meta schema URI to https
935944
- fixes #229 move the remotes to resource from draftv4
936945
- fixes #228 support boolean schema in the dependencies validator
@@ -1307,15 +1316,15 @@ With #896 implemented, it breaks the API. Users code might need to change in ord
13071316

13081317
### Changed
13091318
- Fixes #50 Support custom meta schemas with custom keywords and formats. Thanks @kkalass
1310-
- Fixes #49 Use LinkedHashSets for ValidationMessages. Thanks @ehrmann
1319+
- Fixes #49 Use LinkedHashSets for ValidationMessages. Thanks @ehrmann
13111320
- Fixes #48 Remove unnecessary todo. Thanks @ehrmann
13121321
- Fixes #47 Change access modifiers in ValidationMessage. Thanks @ehrmann
13131322
- Fixes #45 Added test case for loading schemas from classpath. Thanks @kenwa
13141323

13151324

13161325
## 0.1.11 - 2017-10-18
13171326
### Added
1318-
- Fixes #43 Load reference schemas from classpath is supported. Thanks @kenwa
1327+
- Fixes #43 Load reference schemas from classpath is supported. Thanks @kenwa
13191328

13201329
### Changed
13211330

README.md

+22-25
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The [Releases](https://github.com/networknt/json-schema-validator/releases) page
4040

4141
## Comparing against other implementations
4242

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.
4444
* [Functional comparison](https://www.creekservice.org/json-schema-validation-comparison/functional#summary-results-table)
4545
* [Performance comparison](https://www.creekservice.org/json-schema-validation-comparison/performance#json-schema-test-suite-benchmark)
4646

@@ -94,19 +94,19 @@ This implementation is tested against the [JSON Schema Test Suite](https://githu
9494

9595
#### Jackson Parser
9696

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.
9898

9999
#### YAML Support
100100

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.
102102

103103
#### OpenAPI Support
104104

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.
106106

107107
#### Minimal Dependencies
108108

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.
110110

111111
##### Required Dependencies
112112

@@ -204,7 +204,7 @@ The Ethlo Time dependency can be excluded if accurate validation of the `date-ti
204204

205205
#### Community
206206

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.
208208

209209
## Prerequisite
210210

@@ -214,31 +214,31 @@ The library supports Java 8 and up. If you want to build from the source code, y
214214

215215
### Adding the dependency
216216

217-
This package is available on Maven central.
217+
This package is available on Maven central.
218218

219-
#### Maven:
219+
#### Maven:
220220

221221
```xml
222222
<dependency>
223223
<groupId>com.networknt</groupId>
224224
<artifactId>json-schema-validator</artifactId>
225-
<version>1.5.4</version>
225+
<version>1.5.5</version>
226226
</dependency>
227227
```
228228

229229
#### Gradle:
230230

231231
```java
232232
dependencies {
233-
implementation(group: 'com.networknt', name: 'json-schema-validator', version: '1.5.4');
233+
implementation(group: 'com.networknt', name: 'json-schema-validator', version: '1.5.5');
234234
}
235235
```
236236

237237
### Validating inputs against a schema
238238

239239
The following example demonstrates how inputs are validated against a schema. It comprises the following steps.
240240

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.
242242
* Configuring mapping the `$id` to a retrieval URI using `schemaMappers`.
243243
* Configuring how the schemas are loaded using the retrieval URI using `schemaLoaders`.
244244
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
250250
// This creates a schema factory that will use Draft 2020-12 as the default if $schema is not specified
251251
// in the schema data. If $schema is specified in the schema data then that schema dialect will be used
252252
// instead and this version is ignored.
253-
JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(VersionFlag.V202012, builder ->
253+
JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(VersionFlag.V202012, builder ->
254254
// This creates a mapping from $id which starts with https://www.example.org/ to the retrieval URI classpath:schema/
255255
builder.schemaMappers(schemaMappers -> schemaMappers.mapPrefix("https://www.example.org/", "classpath:schema/"))
256256
);
@@ -312,29 +312,29 @@ Set<ValidationMessage> assertions = schema.validate(input, InputFormat.JSON, exe
312312
// By default since Draft 2019-09 the format keyword only generates annotations and not assertions
313313
executionContext.getExecutionConfig().setFormatAssertionsEnabled(true);
314314
});
315-
```
315+
```
316316
### Results and output formats
317317

318318
#### Results
319319

320320
The following types of results are generated by the library.
321321

322-
| Type | Description
322+
| Type | Description
323323
|-------------|-------------------
324324
| 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.
325325
| 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.
326326

327327
The following information is used to describe both types of results.
328328

329-
| Type | Description
329+
| Type | Description
330330
|-------------------|-------------------
331331
| 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```
332332
| 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```
333333
| Instance Location | This is the JSON pointer fragment to the instance data that was being evaluated. eg. ```/bar/bar-prop```
334334

335335
Assertions contains the following additional information
336336

337-
| Type | Description
337+
| Type | Description
338338
|-------------------|-------------------
339339
| Message | The validation error message.
340340
| Code | The error code.
@@ -349,7 +349,7 @@ Assertions contains the following additional information
349349

350350
Annotations contains the following additional information
351351

352-
| Type | Description
352+
| Type | Description
353353
|-------------------|-------------------
354354
| Value | The annotation value generated
355355

@@ -411,7 +411,7 @@ This library implements the Flag, List and Hierarchical output formats defined i
411411

412412
The List and Hierarchical output formats are particularly helpful for understanding how the system arrived at a particular result.
413413

414-
| Output Format | Description
414+
| Output Format | Description
415415
|-------------------|-------------------
416416
| Default | Generates the list of assertions.
417417
| 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
425425
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(VersionFlag.V202012);
426426
SchemaValidatorsConfig config = SchemaValidatorsConfig().builder().formatAssertionsEnabled(true).build();
427427
JsonSchema schema = factory.getSchema(SchemaLocation.of("https://json-schema.org/schemas/example"), config);
428-
428+
429429
OutputUnit outputUnit = schema.validate(inputData, InputFormat.JSON, OutputFormat.HIERARCHICAL, executionContext -> {
430430
executionContext.getExecutionConfig().setAnnotationCollectionEnabled(true);
431431
executionContext.getExecutionConfig().setAnnotationCollectionFilter(keyword -> true);
@@ -533,7 +533,7 @@ The following is sample output from the Hierarchical format.
533533
| `readOnly` | Whether schema is read only. This affects the `readOnly` keyword. | `null`
534534
| `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()`
535535
| `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. |
537537
| `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`
538538
| `writeOnly` | Whether schema is write only. This affects the `writeOnly` keyword. | `null`
539539

@@ -594,13 +594,13 @@ The library assumes that the schemas being loaded are trusted. This security mod
594594

595595
## Projects
596596

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.
598598

599599
If you have a project using this library, please submit a PR to add your project below.
600600

601601
## Contributors
602602

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.
604604

605605
[@stevehu](https://github.com/sponsors/stevehu)
606606

@@ -644,6 +644,3 @@ If you are a contributor, please join the [GitHub Sponsors](https://github.com/s
644644

645645

646646
### Corporation Sponsors
647-
648-
649-

0 commit comments

Comments
 (0)