All notable changes will be documented in this file. Swagger Parser adheres to Semantic Versioning.
v10.0.0 (2020-07-10)
- Removed the
YAML
export. We recommend using@stoplight/yaml
instead
- Added a new
continueOnError
option that allows you to get all errors rather than just the first one
v9.0.0 (2020-03-14)
-
Moved Swagger Parser to the @APIDevTools scope on NPM
-
The "swagger-parser" NPM package is now just a wrapper around the scoped "@apidevtools/swagger-parser" package
v8.0.0 (2019-06-22)
- The
validate()
function now uses the official JSON Schemas for Swagger 2.0 and OpenAPI 3.0 schema validation. We tested this change on over 1,500 real-world APIs and there were no breaking changes, but we're bumped the major version number just to be safe.
v7.0.0 (2019-06-12)
-
Dropped support for Node 6
-
Updated all code to ES6+ syntax (async/await, template literals, arrow functions, etc.)
-
No longer including a pre-built bundle in the package. such as Webpack, Rollup, Parcel, or Browserify to include Swagger Parser in your app
- Added TypeScript definitions
v6.0.0 (2018-10-05)
v5.0.0 (2018-05-25)
- After months and months of delays, initial support for OpenAPI 3.0 is finally here! A big "Thank You!" to Leo Long for doing the work and submitting PR #88.
v4.1.0 (2018-04-11)
- @marcelstoer submitted PR #83 and PR #84, both of which improve the
validate()
method. It will now detect when a JSON Schema in your API definition hasrequired
properties that don't exist.
v4.0.0 (2017-10-19)
-
Update the Swagger 2.0 JSON schema, so it's possible that an API that previously passed validation may no longer pass due to changes in the Swagger schema
-
To reduce the size of this library, it no longer includes polyfills for Promises and TypedArrays, which are natively supported in the latest versions of Node and web browsers. If you need to support older browsers (such as IE9), then just use this
Promise
polyfill and thisTypedArray
polyfill.
- PR #74 - Fixes an edge-case bug with the
validate()
method andx-
vendor extensions
v4.0.0-beta.2 (2016-04-25)
Fixed issue #13. You can now pass a URL and an object to any method.
SwaggerParser.validate("http://example.com/my-schema.json", mySchemaObject, {})
NOTE: As shown in the example above, you must also pass an options object (even an empty object will work), otherwise, the method signature looks like you're just passing a URL and options.
v4.0.0-beta.1 (2016-04-10)
That's the major new feature in this version. Originally requested in PR #8, and refined a few times over the past few months, the plug-in API is now finalized and ready to use. You can now define your own resolvers and parsers.
The available options have changed, mostly due to the new plug-in API. There's not a one-to-one mapping of old options to new options, so you'll have to read the docs and determine which options you need to set. If any. The out-of-the-box configuration works for most people.
All of the caching options have been removed. Instead, files are now cached by default, and the entire cache is reset for each new parse operation. Caching options may come back in a future release, if there is enough demand for it. If you used the old caching options, please open an issue and explain your use-case and requirements. I need a better understanding of what caching functionality is actually needed by users.
Lots of little bug fixes, and a couple major bug fixes:
- completely rewrote the bundling logic to fix issue #16
- Added support for root-level
$ref
s
v3.3.0 (2015-10-02)
Updated to the latest version of the Official Swagger 2.0 Schema. The schema hadn't been updated for six months, so Swagger Parser was missing several recent changes.
v3.2.0 (2015-10-01)
Swagger Parser now uses call-me-maybe to support promises or callbacks.
v3.1.0 (2015-09-28)
Fixed several bugs with circular references, particularly with the validate()
method.
Added a new $refs.circular
option to determine how circular references are handled. Options are fully-dereferencing them (default), throwing an error, or ignoring them.
v3.0.0 (2015-09-25)
This is a complete rewrite of Swagger Parser. Major changes include:
Swagger 2.0 Compliant
Previous versions of Swagger Parser were based on early drafts of Swagger 2.0, and were not compliant with the final version of the spec. Swagger Parser v3.0 is now compliant with the final spec as well as related specs, such as JSON Reference and JSON Pointer
All-New API
The old API only had a single method: parse()
. But depending on which options you passed it, the method did much more than its name implied. The new API has separate methods to make things a bit more intuitive. The most commonly used will be validate()
, bundle()
, and dereference()
. The parse()
and resolve()
methods are also available, but these are mostly just for internal use by the other methods.
Asynchronous API
The old API was "asynchronous", but it relied on global state, so it did not support multiple simultaneous operations. The new API is truly asynchronous and supports both ES6 Promises and Node-style callbacks.
New JSON Schema Validator
Swagger Parser has switched from tv4 to Z-Schema, which is faster and performs more accurate validation. This means that some APIs that previously passed validation will now fail. But that's a good thing!