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 theawait
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.