Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slate-io/swagger-spec-validator
:100: Validate the integrity of your Swagger API specifications within your CI
https://github.com/slate-io/swagger-spec-validator
continuous-integration swagger swagger-spec swagger-specification swagger-validator
Last synced: about 2 months ago
JSON representation
:100: Validate the integrity of your Swagger API specifications within your CI
- Host: GitHub
- URL: https://github.com/slate-io/swagger-spec-validator
- Owner: slate-io
- License: mit
- Created: 2017-01-14T22:07:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T06:30:32.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T23:41:40.364Z (3 months ago)
- Topics: continuous-integration, swagger, swagger-spec, swagger-specification, swagger-validator
- Language: JavaScript
- Homepage: http://slate-io.com/slate/swagger/ci/2017/01/16/Adding-Swagger-Specification-Validation/
- Size: 50.8 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# swagger-spec-validator [![Build Status](https://img.shields.io/travis/slate-io/swagger-spec-validator.svg?style=flat-square)](https://travis-ci.org/slate-io/swagger-spec-validator) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo) [![Docker Pulls](https://img.shields.io/docker/pulls/slate/swagger-spec-validator.svg?style=flat-square)](https://hub.docker.com/r/slate/swagger-spec-validator/)
Validate and ensure the integrity of your Swagger API specifications to any existing repository, all within a few steps.
## Usage
> Swagger files **must** match the filename format: `*.swagger.json` | `*.swagger.yaml` | `*.swagger.yml`
Pull the Docker image from the registry, and follow the steps below to validate:
```
$ docker pull slate/swagger-spec-validator
$ cd /YOUR_PROJECT_WITH_SPECS
$ docker run -it -e "SPEC_PATH=$SPEC_PATH" -v $SPEC_PATH:/data --name spec-validator slate/swagger-spec-validator:latest
$ docker logs $(docker ps -lq)
```The output of the command should yield: `The command "docker logs $(docker ps -lq)" exited with 0.`
### Travis CI
Copy the [`.travis.yml`](https://github.com/slate-io/swagger-spec-validator/blob/master/.travis.yml) file into the root of the repository containing your Swagger specifications. The directory structure of the project should resemble the following structure:
```
.
├── .travis.yml
├── LICENSE
└── cisco
└── ios
└── 12_4_0
└── 2017-01-15.swagger.json
└── 2017-01-15.swagger.yml
└── 12_4_1
└── 2017-02-15.swagger.json
└── 2017-02-15.swagger.yml
```An example repository can be found at [Slate-io Specs](https://github.com/slate-io/specifications).
## License
MIT © [Slate-io Team](https://github.com/slate-io)