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
Bot releases are visible (Hide)
Published by stoplight-bot over 5 years ago
Published by stoplight-bot over 5 years ago
spectral.run()
method is now async, so add the await
keyword before itspectral.run()
method now returns an array of results, instead of an object containing an arrayschema-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.
Published by stoplight-bot over 5 years ago