All Projects → APIDevTools → Swagger Parser

APIDevTools / Swagger Parser

Licence: mit
Swagger 2.0 and OpenAPI 3.0 parser/validator

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Swagger Parser

Prance
Resolving Swagger/OpenAPI 2.0 and 3.0 Parser
Stars: ✭ 133 (-81.27%)
Mutual labels:  swagger, openapi, resolver, parser, validator
Swagger Cli
Swagger 2.0 and OpenAPI 3.0 command-line tool
Stars: ✭ 321 (-54.79%)
Mutual labels:  swagger, json-schema, parser, validation, validator
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-96.9%)
Mutual labels:  validation, json-schema, swagger, openapi
json-ref-resolver
[Deprecated] Recursively resolve JSON pointers and remote authorities.
Stars: ✭ 27 (-96.2%)
Mutual labels:  resolver, json-schema, swagger, openapi
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (+17.04%)
Mutual labels:  rest-api, swagger, openapi, json-schema
Oas Kit
Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint
Stars: ✭ 516 (-27.32%)
Mutual labels:  swagger, openapi, validator
Json Schema Ref Parser
Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
Stars: ✭ 532 (-25.07%)
Mutual labels:  json-schema, resolver, parser
Swagger Express Middleware
Swagger 2.0 middlware and mocks for Express.js
Stars: ✭ 543 (-23.52%)
Mutual labels:  rest-api, swagger, openapi
Jsonschema
An implementation of the JSON Schema specification for Python
Stars: ✭ 3,474 (+389.3%)
Mutual labels:  validation, json-schema, openapi
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-93.38%)
Mutual labels:  validation, validator, openapi
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-64.08%)
Mutual labels:  rest-api, swagger, openapi
Full Stack Fastapi Postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Stars: ✭ 7,635 (+975.35%)
Mutual labels:  swagger, openapi, json-schema
openapi-schema-validator
OpenAPI schema validator for Python
Stars: ✭ 35 (-95.07%)
Mutual labels:  validation, swagger, openapi
fhir-fuel.github.io
Place to prepare proposal to FHIR about JSON, JSON-Schema, Swagger/OpenAPI, JSON native databases and other JSON-frendly formats (yaml, edn, avro, protobuf etc) and technologies
Stars: ✭ 20 (-97.18%)
Mutual labels:  json-schema, swagger, openapi
Dredd
Language-agnostic HTTP API Testing Tool
Stars: ✭ 3,770 (+430.99%)
Mutual labels:  swagger, openapi, validation
Ring Swagger
Swagger Spec for Clojure Web Apps
Stars: ✭ 351 (-50.56%)
Mutual labels:  swagger, openapi, json-schema
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (-45.77%)
Mutual labels:  swagger, openapi, parser
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 (+2897.04%)
Mutual labels:  rest-api, swagger, openapi
openui5-validator
A library to validate OpenUI5 fields
Stars: ✭ 17 (-97.61%)
Mutual labels:  validation, json-schema, validator
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-96.2%)
Mutual labels:  validation, json-schema, validator

Swagger 2.0 and OpenAPI 3.0 parser/validator

Build Status Coverage Status Tested on APIs.guru

npm Dependencies License Buy us a tree

OS and Browser Compatibility

Online Demo

Features

  • Parses Swagger specs in JSON or YAML format
  • Validates against the Swagger 2.0 schema or OpenAPI 3.0 Schema
  • Resolves all $ref pointers, including external files and URLs
  • Can bundle all your Swagger files into a single file that only has internal $ref pointers
  • Can dereference all $ref pointers, giving you a normal JavaScript object that's easy to work with
  • Tested in Node.js and all modern web browsers on Mac, Windows, and Linux
  • Tested on over 1,500 real-world APIs from Google, Microsoft, Facebook, Spotify, etc.
  • Supports circular references, nested references, back-references, and cross-references
  • Maintains object reference equality — $ref pointers to the same value always resolve to the same object instance

Related Projects

Example

SwaggerParser.validate(myAPI, (err, api) => {
  if (err) {
    console.error(err);
  }
  else {
    console.log("API name: %s, Version: %s", api.info.title, api.info.version);
  }
});

Or use async/await or Promise syntax instead. The following example is the same as above:

try {
  let api = await SwaggerParser.validate(myAPI);
  console.log("API name: %s, Version: %s", api.info.title, api.info.version);
}
catch(err) {
  console.error(err);
}

For more detailed examples, please see the API Documentation

Installation

Install using npm:

npm install @apidevtools/swagger-parser

Usage

When using Swagger Parser in Node.js apps, you'll probably want to use CommonJS syntax:

const SwaggerParser = require("@apidevtools/swagger-parser");

When using a transpiler such as Babel or TypeScript, or a bundler such as Webpack or Rollup, you can use ECMAScript modules syntax instead:

import SwaggerParser from "@apidevtools/swagger-parser";

Browser support

Swagger Parser supports recent versions of every major web browser. Older browsers may require Babel and/or polyfills.

To use Swagger Parser in a browser, you'll need to use a bundling tool such as Webpack, Rollup, Parcel, or Browserify. Some bundlers may require a bit of configuration, such as setting browser: true in rollup-plugin-resolve.

API Documentation

Full API documentation is available right here

Contributing

I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.

Building/Testing

To build/test the project locally on your computer:

  1. Clone this repo
    git clone https://github.com/APIDevTools/swagger-parser.git

  2. Install dependencies
    npm install

  3. Run the build script
    npm run build

  4. Run the tests
    npm test

License

Swagger Parser is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Big Thanks To

Thanks to these awesome companies for their support of Open Source developers ❤

GitHub NPM Coveralls Travis CI SauceLabs

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].