THIS CHANGELOG IS NO LONGER MAINTAINED
EACH SUB-PACKAGE LISTED UNDER PACKAGES/ HAS ITS OWN CHANGELOG
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Ruleset: New alternative ruleset format #1615
- Ruleset: ESLint-like Overrides #1021
- Ruleset: Path Aliases #1680
- Rulesets: OpenAPI (OAS) 3.1 support #1302
- Functions:
schema
function uses Ajv v8 under the hood and therefore support newer JSON Schema drafts #1584 - CLI: implement
--stdin-filepath
flag #1001 - Formats: JSON Schema Draft 2020-12 format #1556
- CLI: added pretty formatter for colored and wrapped cli output #1580
- Rulesets: Supports
x-nullable
for OAS2 #1359 - Rulesets:
oas3-unused-component
rule which detects all orphaned components #1440
- Ruleset validation yields more understandable errors #1637
- CLI: demand some ruleset to be present #1699
- CLI: require valid commands and options #1586
- Core: revise
RulesetFunction
akaIFunction
#1685 - Core: runtime exceptions are not swallowed #1618
- Rulesets: Certain oas{2,3}-valid-*-example rules have been merged #1313
- Rulesets: more consistent linting messages in AsyncAPI & OpenAPI rulesets #1619
- Rulesets:
operation-2xx-response
rule has been renamed tooperation-success-response
and is no longer recommended #1272 - Rulesets:
openapi-tags
rule is no longer recommended #1132
- Core: Incorrect range when semicolons are present in a key #1697
- Core: Empty $refs should not be ignored #1515
- Rulesets: validate 'default' in schemas #1402
- Support for Node 10.x #1542
- Functions:
schemaPath
function #1621 - CLI:
--skip-rule
and--show-unmatched-globs
flags #1560 - Core: exceptions #1675
- Rulesets:
operation-default-response
rule #1304
duplicated-entry-in-enum
rule complains aboutenum
property in objects #1571- Dependencies upgrade, including
proxy-agent
#1552
- Add
duplicated-entry-in-enum
rule to detect duplicated entry in enum #1478 - Improve
additionalProperties
JSON Schema validation #1433
- $refs in rulesets linking to json-schema.org are kept unresolved #1519
- Empty $refs should not be ignored #1540
- Proper source detection of an error caused by an empty $ref #1515
- Improve file $ref resolving on Windows #1514
- Proxy settings not applied to all outgoing requests #1324
- Pascal/Camel
casing
do not support single uppercase letters at the end #1500 - Nested extends broken in rulesets Error disabling an extended ruleset in an extended ruleset #1352, #1380
- Missing validation of child parameter child properties #1400
- Address Immer potential security vulnerability, as well as update a few other dependencies #1499
- CLI: add JSON path to stylish formatter #1382
- Support optional pointers and sources in
except
#1405, #1423
- OpenAPI
path-params
rule flags parameter override definitions as duplicate #1416 - Falsy OpenAPI
example
fields are validated correctly #1418 - OpenAPI examples in examples is asked to be OpenAPI compliant #1406
- Allow single trailing slash for OpenAPI 3 server url #1427
- Friendly error is thrown for empty ruleset #1407
- Various general improvements for OpenAPI rules using custom functions #1362
- Documentation URL in rulesets point at legacy Stoplight platform #1395
- Introduce parser options #1350
- Allow
documentationUrl
to be specified for each rule #1356 - CLI: new
--fail-on-unmatched-globs
flag #1117
- CLI:
--fail-on-unmatched-globs
should be used instead of--show-unmatched-globs
- CLI: JUnit formatter respects fail-severity #935
- Respect nullable in case of OAS3 document #1353
- Schema function handles non-string enum values #1377
oas-valid-example
ignores externalValue #1379- Expose
defined
function correctly #1384
- YAML merge keys can be used in rulesets #1325
- New built-in function
defined
#1338 - Enhance error message formatting #1339
- JS API: Document format lookup functions takes filepath #1348
- JS API: Support proxies #1081
- Ruleset accepts
documentationUrl
property to specify the source of the documentation #1242 - Introduce an experimental JSON Path engine to speed up the linting process #1136. Currently hidden behind USE_NIMMA env variable.
- Improve examples validation #1284
- Path Params being applied to more than http operations #1187
- Occasional out of memory errors caused by better-ajv-errors #1223, #455
- Unexpected result while linting an empty document #1209
- Casing function supports leading char #1256
operation-paramaters
rule outputs better messages #1235- Document sources are not normalized correctly under Windows #1185
- Various performance improvements #1184, #1188, #1189, #1300
- New AsyncAPI 2 ruleset and format #965
- Custom functions can be async #694
- Expose fetch and cache to custom functions #1078, #1079
- Drop
example-value-or-externalValue
rule and introduceoas3-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
- Improve
oas2-schema
andoas3-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
- Built-in functions can now be accessed from custom functions #925
- CLI:
--show-unmatched-globs
flag #747
typed-enum
function is no longer a built-in function. It's been migrated into a custom function of the OpenAPI ruleset #924openapi-tags
rule has been fixed to make it fit its description #1038
- 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
- YAMLIncompatibleValue diagnostics are now considered warnings #1009
- Alphabetical rule works correctly for $refs #979
- Implement a new
typed-enum
rule to detect enum value that do not respect specified type #913 - API: introduced document #876 - note, this is not a breaking change
- Introduce optional enhancers to casing function #884
- 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 #899schema-path
accepts a JSON Path expression as a field selector #917schema-path
handles invalid values gracefully #917oas3-valid-(content-)schema-example
rules handle nullable correctly #914
- 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
- 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
andopenapi-tags
, are now included in the recommended rulset #725 #706 - BREAKING: The
model-description
andoperation-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 nowerror
, so getting awarn
,info
or ahint
will not return a exit status code #706 - Rulesets no longer require a
rules
property #652
- Circular remote references with JSON pointers are resolved correctly json-ref-resolver#141
- Local root JSON pointers are resolved correctly json-ref-resolver#146
- Invalid JSON pointers are reported as errors now json-ref-resolver#140 and json-ref-resolver#147
- Unixify glob patterns under Windows #679
- Improved duplicate keys detection #751
- Spectral should be usable in browsers with no crypto module available #846
- Falsy values are printed in validation messages #824
- Validation results are no longer duplicate #680, #737 and #856
- 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
when
Rule property is deprecated #585
- 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
schema
function can validate falsy values 10e5d1cschema
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
andhint
severity levels correctly #565
- CLI: missing tslib #524
- 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
- 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
addRules
andaddFunctions
have been deprecated, usesetRules
andsetFunctions
instead- Importing built-in ruleset in cjs/esm module way (via require or import) is no longer recommended. Consider using
#loadRuleset
instead
- 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
- Resolve references to files with relative paths
- Tweaked JSON Path lookup for paths to avoid deep scan, speeding up linting for large documents #413
- NPM install for Windows users was failing due to a dependency not supporting Windows in their build script
- Using the CLI with multiple, custom rulesets
- New syntax for rulesets, including overriding rules and extending rulesets
- More friendly errors and warnings
- CLI
--quiet
flag added to lint command, removing any output other than results - CLI
--skip-rules
flag added to lint command, to ignore certain rules
- CLI now reports errors and warnings for referenced (
$ref
) files
- Configuration files were briefly available in 3.x but removed in v4.0
- CLI
--max-results
flag is removed