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
- Host: GitHub
- URL: https://github.com/sylvainlaurent/swagger-validator-maven-plugin
- Owner: sylvainlaurent
- License: apache-2.0
- Created: 2016-03-09T21:53:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T19:43:36.000Z (over 1 year ago)
- Last Synced: 2024-04-16T11:00:25.259Z (about 1 year ago)
- Topics: maven-plugin, openapi-validation, swagger
- Language: Java
- Homepage:
- Size: 215 KB
- Stars: 11
- Watchers: 6
- Forks: 6
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](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).