spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.

APACHE-2.0 License

Downloads
22.3M
Stars
2.3K
Committers
92

Bot releases are visible (Hide)

spectral - v2.4.0

Published by stoplight-bot over 5 years ago

2.4.0 (2019-05-20)

Bug Fixes

  • improve usefulness of path-params linting messages (#219) (b9060b7)

Features

spectral - v2.3.2

Published by stoplight-bot over 5 years ago

2.3.2 (2019-05-17)

Bug Fixes

spectral - v2.3.1

Published by stoplight-bot over 5 years ago

2.3.1 (2019-05-16)

Bug Fixes

  • ignore openapi-only formats to avoid errors (#209) (c1798fc), closes #187
spectral - v2.3.0

Published by stoplight-bot over 5 years ago

2.3.0 (2019-05-14)

Features

spectral - v2.2.0

Published by stoplight-bot over 5 years ago

2.2.0 (2019-05-11)

Features

spectral - v2.1.1

Published by stoplight-bot over 5 years ago

2.1.1 (2019-05-01)

Bug Fixes

  • Bump @stoplight/yaml from 2.2.0 to 2.2.1 (#175) (3c311f6)
spectral - v2.1.0

Published by stoplight-bot over 5 years ago

2.1.0 (2019-04-25)

Features

spectral - v2.0.6

Published by stoplight-bot over 5 years ago

2.0.6 (2019-03-31)

Bug Fixes

spectral - v2.0.5

Published by stoplight-bot over 5 years ago

2.0.5 (2019-03-30)

Bug Fixes

  • correctly set unique id rule as an error (#119) (551ee3c)
spectral - v2.0.4

Published by stoplight-bot over 5 years ago

2.0.4 (2019-03-29)

Bug Fixes

spectral - v2.0.3

Published by stoplight-bot over 5 years ago

2.0.3 (2019-03-28)

Bug Fixes

spectral - v2.0.2

Published by stoplight-bot over 5 years ago

2.0.2 (2019-03-28)

Bug Fixes

spectral - v2.0.1

Published by stoplight-bot over 5 years ago

2.0.1 (2019-03-28)

Bug Fixes

  • build: package.json was not including all files (d588f62)
spectral - v2.0.0

Published by stoplight-bot over 5 years ago

2.0.0 (2019-03-28)

Features

  • Added a CLI for linting without needing to play with JavaScript (#105)
  • Use json-ref-parser by default to provide dereferenced object, (#99)
  • Add file paths and line numbers to results, used for CLI output (#106 & #117)
  • Show YAML parsing errors as results (#118)

BREAKING CHANGES

  • The spectral.run() method is now async, so add the await keyword before it
  • The spectral.run() method now returns an array of results, instead of an object containing an array
  • Removed schema-items-is-object rule (#100) (2e5902f)

Before

const resolved = someCustomResolver(specification);
const results = spectral.run(specification, { resolvedTarget: resolved });
console.log(results.results) // [ { ... } ]

After

const results = await spectral.run(specification);
console.log(results) // [ { ... } ]

This is a big simplification to the API, as it will resolve things for you (internal $ref only, so any $ref which is pointing to a location within the same file).

The ability to pass in other resolvers to support external references or other resolving strategies will come in future versions.

spectral - v1.2.0

Published by stoplight-bot over 5 years ago

1.2.0 (2019-03-15)

Features

  • oas: check examples are valid against their schema (#101) (3034df3)
spectral - v1.1.2

Published by stoplight-bot over 5 years ago

1.1.2 (2019-03-11)

Bug Fixes

spectral - v1.1.1

Published by stoplight-bot over 5 years ago

1.1.1 (2019-03-04)

Bug Fixes

  • force release with jsonpath dep updated (#96) (06868a3)
spectral - v1.1.0

Published by stoplight-bot over 5 years ago

1.1.0 (2019-02-21)

Bug Fixes

  • a typo and a probable cut-and-paste error (6aebc7d)
  • add operation-operationId-valid-in-url (#86) (dd46d06)
  • allow path-keys-no-trailing-slash empty slash (#85) (3f7af7d)

Features

spectral - v1.0.2

Published by stoplight-bot over 5 years ago

1.0.2 (2019-02-04)

Bug Fixes

  • a typo and a probable cut-and-paste error (5900c3a)
  • add operation-operationId-valid-in-url (#86) (e550cb6)
  • allow path-keys-no-trailing-slash empty slash (#85) (33a4a06)
spectral - v1.0.1

Published by marbemac almost 6 years ago

1.0.1 (2018-12-21)

Bug Fixes

  • severity: default severity should be warning (#74) (11fa690)
Package Rankings
Top 1.02% on Npmjs.org
Top 24.92% on Repo1.maven.org
Top 8.17% on Proxy.golang.org
Top 36.01% on Pypi.org
Badges
Extracted from project README
Demo of Spectral linting an OpenAPI document from the CLI CircleCI npm Downloads Stoplight Forest
Related Projects