# swagger-parser-js

> parse swagger specs into things you care about

Latest version **1.3.6** (published 2017-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install swagger-parser-js
pnpm add swagger-parser-js
yarn add swagger-parser-js
bun add swagger-parser-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2017-07-10 |
| First published | 2017-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Terrence Wong |
| Maintainers | wongterrencew |

## Links

- npm: https://www.npmjs.com/package/swagger-parser-js
- Repository: https://github.com/wongterrencew/swagger-parser-js
- Homepage: https://github.com/wongterrencew/swagger-parser-js#readme
- Issues: https://github.com/wongterrencew/swagger-parser-js/issues
- npm.io page: https://npm.io/package/swagger-parser-js

## Dependencies (3)

- [lodash.map](https://npm.io/package/lodash.map.md) ^4.6.0
- [lodash.reduce](https://npm.io/package/lodash.reduce.md) ^4.6.0
- [lodash.foreach](https://npm.io/package/lodash.foreach.md) ^4.5.0

## Recent versions

- 1.3.6 (latest) — 2017-07-10
- 1.3.5 — 2017-07-10
- 1.3.4 — 2017-07-10
- 1.3.3 — 2017-07-10
- 1.3.2 — 2017-07-10
- 1.3.1 — 2017-07-10
- 1.3.0 — 2017-07-10
- 1.2.0 — 2017-07-06
- 1.1.5 — 2017-06-29
- 1.1.4 — 2017-06-29
- 1.1.3 — 2017-06-29
- 1.1.2 — 2017-06-29
- 1.1.1 — 2017-06-29
- 1.1.0 — 2017-06-26
- 1.0.0 — 2017-06-26

## README

# swagger-parser-js

```js
const swaggerJson = require('./path/to/your/swagger.json')
const Schema = require('swagger-parser-js')
const schema = new Schema(swaggerJson)

// get properties about the schema
schema.info()
schema.version()
schema.paths()
...
// you get it...

// the useful methods:
// returns an array of Operations
schema.operations()

// returns an array of Operations and also includes `consumes` and `produces` properties
schema.operationsWithRootInherited()

// returns a map of tags to an array of operations for that tag
schema.operationsWithTags()

// returns a map of tags to objects containing tag details and an array of operations
schema.taggedOperations()

// returns a map of tags to objects containing tag details and an array of operations
// each operation has an extra property `x-response-example`
schema.taggedOperationsWithExamples()

// TODO: document this way better
// use flow as documentation?
```

---
_Source: https://npm.io/package/swagger-parser-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
