Validate your Swagger JSON/YAML today!
Clone or download
Latest commit 94152f5 Aug 30, 2018
Failed to load latest commit information.
bin added variable for setting applicaiton path Jan 14, 2016
src/main Add Content-Type to response Aug 23, 2017
.gitignore Added .gitignore May 20, 2015
Dockerfile made nicer Aug 12, 2017
LICENSE Happy new year! Jan 7, 2016 remove travis Aug 30, 2018
pom.xml bump snapshot 1.0.6-SNAPSHOT Jan 26, 2018

Swagger Validator Badge

Build Status Maven Central

This project shows a "valid swagger" badge on your site. There is an online version hosted on You can also pull a docker image of the validator directly from DockerHub.

You can validate any OpenAPI specification against the OpenAPI 2.0 Schema as follows:

<img src="{YOUR_URL}">

Of course the YOUR_URL needs to be addressable by the validator (i.e. won't find anything on localhost). If it validates, you'll get a nice green VALID logo. Failures will give an INVALID logo, and if there are errors parsing the specification or reaching it, an ugly red ERROR logo.

For example, using as a source, we get ...

If your specification fails to validate for some reason, or if there is an error, you can get more information on why by visiting{YOUR_URL}.

Since the validator uses a browserless back-end to fetch the contents and schema, it's not subject to the terrible world of CORS.

You can also post a spec up to the service with CURL:

curl -X POST -d @swagger.json -H 'Content-Type:application/json'

In this example, swagger.json is the swagger definition in JSON format, in the CWD.

Running locally

You can build and run the validator locally:

mvn package jetty:run

And access the validator like such: