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 -

Published by stoplight-bot over 4 years ago

spectral -

Published by stoplight-bot over 4 years ago

Added

  • New AsyncAPI 2 ruleset and format #965
  • Custom functions can be async #694
  • Expose fetch and cache to custom functions #1078, #1079

Changed

  • Drop example-value-or-externalValue rule and introduce oas3-examples-value-or-externalValue #883, #1098
  • Drop useless oas rule tags #1095
  • AJV: swallow missing references #1147
  • Improve ruleset validation #1144
  • Allow running spectral from any directory in Docker #1022

Fixed

  • Improve oas2-schema and oas3-schema rules #403
  • path-params rule now properly detects undefined parameters across operations #1076
  • Load custom functions from NPM correctly #1093
  • Teach path-params to report an actual endpoint path #1130
spectral -

Published by stoplight-bot over 4 years ago

spectral -

Published by stoplight-bot over 4 years ago

Added

  • Built-in functions can now be accessed from custom functions #925
  • CLI: --show-unmatched-globs flag #747

Changed

  • typed-enum function is no longer a built-in function. It's been migrated into a custom function of the OpenAPI ruleset #924
  • openapi-tags rule has been fixed to make it fit its description #1038

Fixed

  • Ruleset exceptions used to slip certain errors through cracks #1018
  • Correct misleading info-license message #1031
  • Requiring packages located under node_modules is possible #1029
  • Set proper document source if legacy parsed result is given #1040
spectral -

Published by stoplight-bot over 4 years ago

Added

  • Rule exceptions are supported #747
  • Allow require calls in Node.JS #1011

Changed

  • YAMLIncomaptibleValue diagnostics are now considered warnings #1009

Fixed

  • Alphabetical rule works correctly for $refs #979
spectral -

Published by stoplight-bot over 4 years ago

Features

  • Implement a new typed-enum rule to detect enum value that do not respect specified type #913

Added

  • API: introduced document #876 - note, this is not a breaking change
  • Introduce optional enhancers to casing function #884

Fixed

  • Improved Example Object validation #882
  • oas3-operation-security-defined rule supports optional authentication #895
  • Generate more correct paths when reporting an error #900
  • example-value-or-externalValue no longer reports false positives #899
  • schema-path accepts a JSON Path expression as a field selector #917
  • schema-path handles invalid values gracefully #917
  • oas3-valid-(content-)schema-example rules handle nullable correctly #914
spectral -

Published by stoplight-bot almost 5 years ago

Features

  • Alphabetical rule function now supports numeric keys #730
  • Non-JSON-ish YAML mapping keys are reported #726
  • CLI: new formatter - text #822
  • CLI: new formatter - teamcity #823
  • CLI: new formatter - HTML #389
  • CLI: custom resolver can be provided leveraging --resolver flag #717
  • CLI: input can be provided via STDIN #757
  • Implement ignoreUnsupportedFormats to make it easier to detect unrecognized formats #678
  • Rule's Given can be an array now #799
  • Casing built-in function is added #564
  • New oas rule - operation-tag-defined #704

Changed

  • BREAKING: The oas2 and oas3 rulesets have been merged into a single oas ruleset #773
  • BREAKING: Deprecated Spectral#addRules and Spectral#addFunctions have been removed #561
  • BREAKING: Some oas rules, such as example-value-or-externalValue and openapi-tags, are now included in the recommended rulset #725 #706
  • BREAKING: The model-description and operation-summary-formatted rules have been removed #725
  • BREAKING: The when rule property has been removed #585
  • BREAKING: Rules are set to recommended by default #719
  • Improved error source detection #685
  • Error paths point at unresolved document #839
  • Validation messages contain more consistent error paths #867
  • CLI: Default --fail-severity is now error, so getting a warn, info or a hint will not return a exit status code #706
  • Rulesets no longer require a rules property #652

Fixed

spectral -

Published by stoplight-bot almost 5 years ago

spectral -

Published by stoplight-bot almost 5 years ago

spectral -

Published by stoplight-bot almost 5 years ago

spectral -

Published by stoplight-bot almost 5 years ago

spectral -

Published by stoplight-bot about 5 years ago

Features

  • CLI: glob patterns and multiple paths are allowed #534
  • CLI: control fail severity and result display #368
  • CLI: new formatter - JUnit #478
  • CLI: add possibility to proxy requests #446
  • Built-in ruleset formats targeting JSON Schema files #571
  • {{value}} and {{path}} can be used in messages #520 #572

Deprecated

  • when Rule property is deprecated #585

Changed

  • Validation results produced by alphabetical function are more meaningful #613
  • Enhanced JSON Schema enum validation #579
  • Improved messages generated by oasPathParam function #537
  • CLI: the amount of enabled rules is now displayed if you run Spectral with --verbose flag #435
  • Stricter source matching for errors #615

Fixed

  • schema function can validate falsy values 10e5d1c
  • schema function can validate Draft 6 and Draft 7 JSON Schemas ea2ddff
  • Parameters in links objects are not linted for not having a description property. #272
  • More accurate ranges for errors occurring in referenced files 6986b82
  • CLI: stylish formatter reports info and hint severity levels correctly #565
spectral -

Published by stoplight-bot about 5 years ago

spectral - v4.2.0-beta1

Published by stoplight-bot about 5 years ago

v4.2.0-beta1

spectral -

Published by stoplight-bot about 5 years ago

spectral -

Published by stoplight-bot about 5 years ago

spectral -

Published by stoplight-bot about 5 years ago

spectral - v4.1.1

Published by stoplight-bot about 5 years ago

Fixed

CLI: missing tslib #524

spectral - v4.1.0

Published by stoplight-bot about 5 years ago

Added

  • Rulesets can be loaded using Spectral#loadRuleset method
  • Custom functions can be registered directly in rulesets
  • Rulesets can be registered against document format
  • New rules: no-$ref-siblings, oas2-anyOf, oas2-oneOf
  • YAML's merge keys are supported
  • $refs can be used in rulesets
  • Resolved document is accessible now if you use Spectral#runWithResolved method #398

Changed

  • valid-example rule has been broken into smaller, more specific rules #223
  • YAML scalar values are parsed according to YAML 1.2 spec #481
  • We swapped oclif with yargs

Deprecated

  • addRules and addFunctions have been deprecated, use setRules and setFunctions instead
  • Importing built-in ruleset in cjs/esm module way (via require or import) is no longer recommended. Consider using #loadRuleset instead

Fixed

  • CLI: relative paths to documents are supported #474
  • Improved path and ranges generation #458, #459
  • Unknown schema formats are no longer printed #396
  • Graceful handling of circular rulesets
  • A few other minor issues
spectral - v4.1.0-beta3

Published by stoplight-bot about 5 years ago

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