Skip to content

Commit

Permalink
Bump the version to 0.15.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
leadpony committed Mar 31, 2019
1 parent 10a2bae commit 7deeb27
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## 0.15.0 - 2019-03-31
### Added
- New `JsonValidatorFactoryBuilder` interface for building configured instances of `JsonParserFactory` or `JsonReaderFactory`.
- Support of `default` keyword in the validations. The missing properties and/or items in the source instances are filled with the default values provided by the keyword. Both `JsonParser` and `JsonReader` support this feature. `JsonParser` produces additional events caused by the default values and `JsonReader` expands objects and arrays with the additional values. This feature is disabled by default and can be enabled explicitly by `withDefaultValues()` in `JsonValidatorFactoryBuilder`.

### Fixed
- The bug which was causing `getArrayStream()`, `getObjectStream()`, and `getValueStream()` in `JsonParser` to throw wrongly `UnsupportedOperationException` in the case that they should throw `IllegalStateException`. (Issue #10)

Expand Down
44 changes: 38 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the following two dependencies are all you need to add to your pom.xml.
<dependency>
<groupId>org.leadpony.justify</groupId>
<artifactId>justify</artifactId>
<version>0.14.0</version>
<version>0.15.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -143,10 +143,9 @@ Displays all available options including those shown above.
* [API Reference in Javadoc]
* [Changelog]

## Current Development Status

### Schema keywords implemented
## Conformance to Specification

All assertion keywords described in [JSON Schema Specification] Draft-07, including `default`, are now supported.
* type
* enum
* const
Expand Down Expand Up @@ -194,10 +193,43 @@ Displays all available options including those shown above.
* regex (compliant with [ECMA 262])
* contentEncoding, with built-in "base64" support.
* contentMediaType, with built-in "application/json" support.
* default

### Schema keywords not implemented yet
## Completion by `default` Keyword

* default
The missing properties and/or items in the instance can be filled with default values provided by `default` keyword while it is being validated.

For example, the input JSON instance shown below
```json
{
"red": 64,
"green": 128,
"blue": 192
}
```

will be filled with the default value and modified to:
```json
{
"red": 64,
"green": 128,
"blue": 192,
"alpha": 255
}
```

Both `JsonParser` and `JsonReader` support the feature. `JsonParser` produces additional events caused by the default values and `JsonReader` expands objects and arrays with the additional values.

By default, this feature is disabled and the instance never be modified. The following code shows how to explicitly enable the feature for the readers.

```java
JsonReaderFactory readerFactory = service.createValidatorFactoryBuilder(schema)
.withProblemHandler(handler)
.withDefaultValues(true) // Enables the default values.
.buildReaderFactory(); // or buildParserFactory() for parsers.
```

For more information, please see [the code sample](https://github.com/leadpony/justify-examples/tree/master/justify-examples-defaultvalue).

## Similar Solutions

Expand Down
2 changes: 1 addition & 1 deletion justify-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.leadpony.justify</groupId>
<artifactId>justify-cli</artifactId>
<version>0.15.0-SNAPSHOT</version>
<version>0.15.0</version>
<packaging>jar</packaging>
<name>org.leadpony.justify.cli</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion justify/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.leadpony.justify</groupId>
<artifactId>justify</artifactId>
<version>0.15.0-SNAPSHOT</version>
<version>0.15.0</version>
<packaging>jar</packaging>
<name>org.leadpony.justify</name>
<description>
Expand Down

0 comments on commit 7deeb27

Please sign in to comment.