@stoplight/spectral
Advanced tools
Comparing version 4.2.0-beta5 to 4.2.0
@@ -8,2 +8,29 @@ # Changelog | ||
## [4.2.0] - 2019-10-08 | ||
### Features | ||
- CLI: glob patterns and multiple paths are allowed [#534](https://github.com/stoplightio/spectral/issues/534) | ||
- CLI: control fail severity and result display [#368](https://github.com/stoplightio/spectral/issues/368) | ||
- CLI: new formatter - JUnit [#478](https://github.com/stoplightio/spectral/issues/478) | ||
- CLI: add possibility to proxy requests [#446](https://github.com/stoplightio/spectral/issues/446) | ||
- Built-in ruleset formats targeting JSON Schema files [#571](https://github.com/stoplightio/spectral/issues/571) | ||
- `{{value}}` and `{{path}}` can be used in messages [#520](https://github.com/stoplightio/spectral/issues/520) [#572](https://github.com/stoplightio/spectral/issues/572) | ||
### Deprecated | ||
- `when` Rule property is deprecated [#585](https://github.com/stoplightio/spectral/issues/585) | ||
### Changed | ||
- Validation results produced by `alphabetical` function are more meaningful [#613](https://github.com/stoplightio/spectral/pull/613) | ||
- Enhanced JSON Schema enum validation [#579](https://github.com/stoplightio/spectral/pull/579) | ||
- Improved messages generated by `oasPathParam` function [#537](https://github.com/stoplightio/spectral/issues/537) | ||
- CLI: the amount of enabled rules is now displayed if you run Spectral with `--verbose` flag [#435](https://github.com/stoplightio/spectral/issues/435) | ||
- Stricter source matching for errors [#615](https://github.com/stoplightio/spectral/pull/615) | ||
### Fixed | ||
- `schema` function can validate falsy values [10e5d1c](https://github.com/stoplightio/spectral/commit/10e5d1c0262790ad8349e25b2e5517e7ae15402c) | ||
- `schema` function can validate Draft 6 and Draft 7 JSON Schemas [ea2ddff](https://github.com/stoplightio/spectral/commit/ea2ddffd58a2a92f483147fec195e0a8fe80c07b) | ||
- Parameters in links objects are not linted for not having a description property. [#272](https://github.com/stoplightio/spectral/issues/272) | ||
- More accurate ranges for errors occurring in referenced files [6986b82](https://github.com/stoplightio/spectral/commit/6986b82bee725aa8733c2d07ccc65a99e14c22c6) | ||
- CLI: stylish formatter reports `info` and `hint` severity levels correctly [#565](https://github.com/stoplightio/spectral/issues/565) | ||
## [4.1.1] - 2019-09-05 | ||
@@ -10,0 +37,0 @@ |
@@ -8,2 +8,3 @@ "use strict"; | ||
const severity_1 = require("./rulesets/severity"); | ||
const utils_1 = require("./utils"); | ||
exports.lintNode = (node, rule, then, apply, resolved) => { | ||
@@ -84,3 +85,11 @@ const givenPath = node.path[0] === '$' ? node.path.slice(1) : node.path; | ||
property: path.length > 0 ? path[path.length - 1] : '', | ||
path: json_1.pathToPointer(path), | ||
description: rule.description, | ||
get value() { | ||
const value = resolved.getValueForJsonPath(path); | ||
if (utils_1.isObject(value)) { | ||
return Array.isArray(value) ? 'Array[]' : 'Object{}'; | ||
} | ||
return JSON.stringify(value); | ||
}, | ||
}), | ||
@@ -87,0 +96,0 @@ path, |
@@ -20,2 +20,3 @@ import { IResolveError } from '@stoplight/json-ref-resolver/types'; | ||
getLocationForJsonPath(path: JsonPath, closest?: boolean): ILocation; | ||
getValueForJsonPath(path: JsonPath): unknown; | ||
} |
@@ -82,4 +82,8 @@ "use strict"; | ||
} | ||
getValueForJsonPath(path) { | ||
const parsedResult = this.getParsedForJsonPath(path); | ||
return parsedResult === null ? void 0 : lodash_1.get(parsedResult.doc.parsed.data, parsedResult.path); | ||
} | ||
} | ||
exports.Resolved = Resolved; | ||
//# sourceMappingURL=resolved.js.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
function resolveSpectralVersion(pkg) { | ||
return String(pkg).replace('@stoplight/spectral', '@stoplight/spectral@4.2.0-beta5'); | ||
return String(pkg).replace('@stoplight/spectral', '@stoplight/spectral@4.2.0'); | ||
} | ||
@@ -12,0 +12,0 @@ function resolveFromNPM(pkg) { |
@@ -0,7 +1,10 @@ | ||
import { Segment } from '@stoplight/types'; | ||
export interface IMessageVars { | ||
property: string | number; | ||
property: Segment; | ||
error: string; | ||
description?: string; | ||
value: unknown; | ||
path: string; | ||
} | ||
export declare type MessageInterpolator = (str: string, values: IMessageVars) => string; | ||
export declare const message: MessageInterpolator; |
{ | ||
"name": "@stoplight/spectral", | ||
"version": "4.2.0-beta5", | ||
"version": "4.2.0", | ||
"description": "A flexible object linter with out of the box support for OpenAPI v2 and v3.", | ||
@@ -108,3 +108,3 @@ "keywords": [ | ||
"lint-staged": "^9.0.2", | ||
"nock": "~11.3.2", | ||
"nock": "~11.4.0", | ||
"pkg": "^4.4.0", | ||
@@ -111,0 +111,0 @@ "recast": "^0.18.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3314708
10981
0