All Projects → swagger-api → Validator Badge

swagger-api / Validator Badge

Licence: apache-2.0
Validate your Swagger JSON/YAML today!

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Validator Badge

Swagger Editor
Swagger Editor
Stars: ✭ 7,365 (+4561.39%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+4265.82%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+13367.72%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Play
Stars: ✭ 320 (+102.53%)
Mutual labels:  rest, swagger, restful-api, openapi-specification
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (-40.51%)
Mutual labels:  swagger, restful-api, openapi3, openapi-specification
Swagger Codegen
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
Stars: ✭ 13,859 (+8671.52%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Parser
Swagger Spec to Java POJOs
Stars: ✭ 468 (+196.2%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Js
Javascript library to connect to swagger-enabled APIs via browser or nodejs
Stars: ✭ 2,319 (+1367.72%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Swagger Inflector
Stars: ✭ 131 (-17.09%)
Mutual labels:  rest, swagger, openapi3, openapi-specification
Drf Spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
Stars: ✭ 414 (+162.03%)
Mutual labels:  swagger, openapi3, openapi-specification
Oas Kit
Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint
Stars: ✭ 516 (+226.58%)
Mutual labels:  swagger, openapi3, openapi-specification
Restful React
A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
Stars: ✭ 1,814 (+1048.1%)
Mutual labels:  rest, swagger, openapi3
Openapi.tools
A collection of Editors, Linters, Parsers, Code Generators, Documentation, Testing
Stars: ✭ 257 (+62.66%)
Mutual labels:  swagger, openapi3, openapi-specification
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+454.43%)
Mutual labels:  swagger, openapi3, openapi-specification
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+24955.7%)
Mutual labels:  rest, swagger, openapi3
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (+425.95%)
Mutual labels:  swagger, openapi3, openapi-specification
Swagger Node
Swagger module for node.js
Stars: ✭ 3,917 (+2379.11%)
Mutual labels:  rest, swagger, openapi-specification
Springdoc Openapi
Library for OpenAPI 3 with spring-boot
Stars: ✭ 1,113 (+604.43%)
Mutual labels:  swagger, openapi3, openapi-specification
Openapi Spring Webflux Validator
🌱 A friendly kotlin library to validate API endpoints using an OpenApi 3.0 and Swagger 2.0 specification
Stars: ✭ 67 (-57.59%)
Mutual labels:  rest, swagger, openapi3
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-86.08%)
Mutual labels:  swagger, openapi-specification, openapi3

Swagger Validator Badge

Build Status

This project shows a "valid swagger" badge on your site, supporting Swagger/OpenAPI 2.0 and OpenAPI 3.0 specifications.

There is an online version hosted on http://validator.swagger.io.

You can also pull a docker image of the validator directly from DockerHub, e.g.:

docker pull swaggerapi/swagger-validator-v2:v2.0.4
docker run -it -p 8080:8080 --name swagger-validator-v2 swaggerapi/swagger-validator-v2:v2.0.4

Since version 2.0.2 local and non http/https urls are rejected by default, along with redirects; this is controllable with docker env variables / java system properties:

docker run -it -p 8080:8080 -e "REJECT_LOCAL=false" -e "REJECT_REDIRECT=false" --name swagger-validator-v2 swaggerapi/swagger-validator-v2:v2.0.4

In non docker environments, system properties rejectLocal and rejectRedirect can be used.

Web UI is reachable at http://localhost:8080/index.html and OpenAPI spec at http://localhost:8080/validator/openapi.json

You can validate any OpenAPI specification against the Swagger/OpenAPI 2.0 Schema and OpenAPI 3.0 Schema as follows:

<img src="https://validator.swagger.io/validator?url={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 https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore-expanded.json 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 https://validator.swagger.io/validator/debug?url={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' https://validator.swagger.io/validator/debug

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

Note that all the above is also applicable to OpenAPI 3.0 specifications; for example, using https://petstore3.swagger.io/api/v3/openapi.json as a source, we get ...

Running locally

You can build and run the validator locally:

mvn package jetty:run

And access the validator like such:

http://localhost:8080/validator?url={URL}

or

http://localhost:8080/validator?url=http://petstore.swagger.io/v2/swagger.json
http://localhost:8080/validator?url=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

Security contact

Please disclose any security-related issues or vulnerabilities by emailing [email protected], instead of using the public issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].