swagger-validator-maven-plugin Maven Plugin

A Maven Plugin to validate yaml and json swagger document

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка Swagger Межпрограммное взаимодействие REST Frameworks
Группа

Группа

com.github.giuliopulina
Идентификатор

Идентификатор

swagger-validator-maven-plugin
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

swagger-validator-maven-plugin Maven Plugin
A Maven Plugin to validate yaml and json swagger document
Ссылка на сайт

Ссылка на сайт

https://github.com/giuliopulina/swagger-validator-maven-plugin
Система контроля версий

Система контроля версий

https://github.com/giuliopulina/swagger-validator-maven-plugin.git

Скачать swagger-validator-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>com.github.giuliopulina</groupId>
    <artifactId>swagger-validator-maven-plugin</artifactId>
    <version>1.0.0</version>
</plugin>

Зависимости

compile (10)

Идентификатор библиотеки Тип Версия
org.reflections : reflections jar 0.9.11
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-project jar 2.2.1
org.codehaus.plexus : plexus-utils jar 3.0.8
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.9.8
com.github.fge : json-schema-validator jar 2.2.6
io.swagger : swagger-parser jar 1.0.44
org.apache.commons : commons-lang3 jar 3.6
org.apache.commons : commons-collections4 jar 4.1
net.bytebuddy : byte-buddy jar 1.9.13

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.8.2
org.slf4j : slf4j-simple jar 1.7.22
org.slf4j : slf4j-api jar 1.7.22

Модули Проекта

Данный проект не имеет модулей.

Build Status

swagger-validator-maven-plugin

This maven plugin allows to validate yaml and json files.

Plugin configuration

      <plugin>
        <groupId>com.github.giuliopulina</groupId>
        <artifactId>swagger-validator-maven-plugin</artifactId>
        <version>...</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>validate</goal>
            </goals>
            <configuration>
                <failOnErrors>true</failOnErrors>
              <includes>
                <include>src/main/resources/swagger-*.yml</include>
                <include>src/main/resources/swagger-*.json</include>
                <!-- other <include> may be added -->
              </includes>
              <excludes>
                <exclude>src/main/resources/swagger-do-not-validate*.yml</exclude>
                <!-- <exclude> is optional, others may be added -->
              </excludes>
              <!-- package names where custom validators are located -->
              <customModelValidatorsPackage>com.example.validators</customModelValidatorsPackage>
              <customPathValidatorsPackage>com.example.validators</customPathValidatorsPackage>
            </configuration>
          </execution>
        </executions>
        <dependencies>
            <!-- dependency with custom validators -->
            <dependency>
                <groupId>com.example</groupId>
                <artifactId>custom-validators</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
      </plugin>

Validation failures make the build fail but default. You can change this by setting <failOnErrors>false</failOnErrors>.

You can add your custom validators and provide plugin with them. Extend from ModelValidatorTemplate or PathValidatorTemplate classes for writing your validators and override necessary validation methods. See ReferenceValidator and PathValidator as examples.

Requires java 1.8.

Source code

The source code is available on GitHub : https://github.com/giuliopulina/swagger-validator-maven-plugin

How to build source

Use Maven and a JDK >=8, and run mvn clean verify in the root directory of the git repository.

How to create a release

mvn release:prepare release:perform and answer the questions about version number.

Then push the commits and tags to github.

License

This software is licensed under the Apache Sotware License version 2.0, see LICENSE.txt.

Версии библиотеки

Версия
1.0.0