An open API service indexing awesome lists of open source software.

https://github.com/sylvainlaurent/swagger-validator-maven-plugin

A maven plugin that validates swagger files in yaml and json formats
https://github.com/sylvainlaurent/swagger-validator-maven-plugin

maven-plugin openapi-validation swagger

Last synced: about 1 month ago
JSON representation

A maven plugin that validates swagger files in yaml and json formats

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/sylvainlaurent/swagger-validator-maven-plugin.svg)](https://travis-ci.org/sylvainlaurent/swagger-validator-maven-plugin)

# swagger-validator-maven-plugin

This maven plugin allows to validate yaml and json files.

## Plugin configuration

```xml

com.github.sylvainlaurent.maven
swagger-validator-maven-plugin
...


validate
validate

validate


true

src/main/resources/swagger-*.yml
src/main/resources/swagger-*.json



src/main/resources/swagger-do-not-validate*.yml



com.example.validators
com.example.validators






com.example
custom-validators
${project.version}



```

Validation failures make the build fail but default. You can change this by setting `false`.

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/sylvainlaurent/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](LICENSE.txt).