Giter Site home page Giter Site logo

wonno / yaml-json-validator-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sylvainlaurent/yaml-json-validator-maven-plugin

0.0 2.0 0.0 82 KB

A maven plugin to check that YAML and JSON files are well formed and optionally valid against JSON schemas

License: Apache License 2.0

Java 100.00%

yaml-json-validator-maven-plugin's Introduction

yaml-json-validator-maven-plugin

Build Status

This maven plugin allows to validate yaml and json files to check that they are well formed and optionally validate against JSON schemas.

Both JSON and YAML files can be validated against a JSON schema. The library fge/json-schema-validator is internally used for this.

Plugin configuration

      <plugin>
        <groupId>com.github.sylvainlaurent.maven</groupId>
        <artifactId>yaml-json-validator-maven-plugin</artifactId>
        <version>...</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>validate</goal>
            </goals>
            <configuration>
              <validationSets>
                <validationSet>
                  <jsonSchema>src/main/resources/my-schema.json</jsonSchema>
                  <includes>
                    <include>src/main/resources/*.json</include>
                  </includes>
                  <excludes>
                    <exclude>src/main/resources/do-not-validate*.json</exclude>
                    <!-- <exclude> is optional, others may be added -->
                  </excludes>
                </validationSet>
                <validationSet>
                  <!-- no jsonSchema is specified, check only that file are well formed -->
                  <includes>
                    <include>src/main/resources/*.yml</include>
                  </includes>
                </validationSet>
              </validationSets>
              <!-- Duplicate keys detection is turned on by default. -->
              <detectDuplicateKeys>false</detectDuplicateKeys>
              <allowEmptyFiles>false</allowEmptyFiles>
              <!-- Allow comments in json files is turned off by default -->
              <allowJsonComments>true</allowJsonComments>
              <!-- Trailing commas are not allwed by default -->
              <allowTrailingComma>true</allowTrailingComma>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

Validation failures make the build fail.

Requires java 1.7.

yaml-json-validator-maven-plugin's People

Contributors

sylvainlaurent avatar wilx avatar hhwidera avatar jjjhhhlll avatar muenzner-pro avatar dependabot[bot] avatar

Watchers

James Cloos avatar Wonno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.