Maven plugin to validate json files against a json schema. Uses https://github.com/fge/json-schema-validator library under the covers
Branch: master
Clone or download
Latest commit 6590e89 Sep 19, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Readded per file output with success/failure, added summary with at end. Mar 7, 2016
.gitignore Initial open source release of json schema validator Dec 29, 2015
.travis.yml rename key Sep 19, 2017
CONTRIBUTORS.md Initial open source release of json schema validator Dec 29, 2015
DEPENDENCIES.md
LICENSE Initial open source release of json schema validator Dec 29, 2015
README.md
commit_sign.key rename key Sep 19, 2017
findbugs.exclude.xml Initial open source release of json schema validator Dec 29, 2015
pom.xml Update to api-parent-pom 1.1.1 Feb 12, 2016
settings.xml Added travis and most of sonatype deployment; still waiting for the c… Dec 29, 2015

README.md

json-schema-validator

License: Apache 2 Travis Build Maven Artifact

Maven plugin to validate json files against a json schema. Uses https://github.com/fge/json-schema-validator library under the covers.

Usage

Determine the latest version of the validator in Maven Central.

Add the plugin to your pom either in the plugins or pluginManagement block:

<plugin>
    <groupId>com.groupon.maven.plugin.json</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>VERSION</version>
</plugin>

Configure one or more validation blocks for the plugin in the plugins block:

<plugin>
    <artifactId>json-schema-validator</artifactId>
    <groupId>com.groupon.maven.plugin.json</groupId>
    <executions>
        <execution>
            <phase>verify</phase>
            <goals>
                <goal>validate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <validations>
            <validation>
                <directory>${basedir}/src/main/resources/data</directory>
                <jsonSchema>${basedir}/src/test/resources/data.schema</jsonSchema>
                <includes>
                    <include>**/*.json</include>
                </includes>
            </validation>
        </validations>
    </configuration>
</plugin>

Each validation block specifies the jsonSchema file to validate with as well as the json file(s) to validate from a root directory with standard includes and excludes to select specific file(s).

Building

Prerequisites:

Building:

json-schema-validator> mvn verify

To use the local version you must first install it locally:

json-schema-validator> mvn install

You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.

License

Published under Apache Software License 2.0, see LICENSE

© Groupon Inc., 2014