TraeckIt :: OpenAPI Validator (maven-plugin)

maven plugin to validate OpenAPI specification files.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

it.traeck.tools.openapi
Идентификатор

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

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

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

1.0.2
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

TraeckIt :: OpenAPI Validator (maven-plugin)
maven plugin to validate OpenAPI specification files.
Ссылка на сайт

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

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

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

https://github.com/misl/openapi-validator-maven-plugin

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

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

<plugin>
    <groupId>it.traeck.tools.openapi</groupId>
    <artifactId>openapi-validator-maven-plugin</artifactId>
    <version>1.0.2</version>
</plugin>

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-core jar 3.6.3
org.apache.maven : maven-compat jar 3.6.3
org.apache.maven : maven-plugin-api jar 3.6.3
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0
io.swagger.parser.v3 : swagger-parser jar 2.0.19
io.swagger.parser.v3 : swagger-parser-v2-converter jar 2.0.19

provided (1)

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

test (1)

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

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

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

openapi-validator-maven-plugin

A Maven plugin to support validation of and conversion (YAML vs JSON) to OpenAPI (swagger) files using the Swagger Parser library.

It not only verifies whether the API specification files are valid, but also merges splitted files into a single YAML or JSON file. This is especially usefull where tools can not cope with JSON $ref references to external files.

More info on splitted OpenAPI specification files read Design Web APIs

Usage

Add to your build->plugins section (default phase is generate-sources phase)

<plugin>
  <groupId>it.traeck.tools.openapi</groupId>
  <artifactId>openapi-validator-maven-plugin</artifactId>
  <version>1.0.2</version>
  <executions>
    <execution>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
        <outputPath>${project.build.directory}/generated-specification</outputPath>
        <outputFilename>openapi</outputFilename>
        <outputFormat>JSONANDYAML</outputFormat>
      </configuration>
    </execution>
  </executions>
</plugin>

Followed by:

mvn clean compile

General Configuration parameters

Parameter Description Required Default
inputSpec OpenAPI Spec file path true
outputPath target output path false ${project.build.directory}/generated-specification
outputFilename Output filename (without extension) false openapi
outputFormat Output file format (JSON, YAML, JSONANDYAML) false JSON
encoding encoding to use for output files false ${project.build.sourceEncoding}
prettyPrint whether to pretty print (true) output or not false true

Sample configurations

Please see example configurations for how to use this maven plugin.

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

Версия
1.0.2
1.0.1
1.0.0