swagger-parser
Advanced tools
Comparing version 3.2.1 to 3.3.0
/** ! | ||
* Swagger Parser v3.2.1 | ||
* Swagger Parser v3.3.0 | ||
* | ||
@@ -4,0 +4,0 @@ * @link https://github.com/BigstickCarpet/swagger-parser |
@@ -5,4 +5,4 @@ 'use strict'; | ||
ono = require('ono'), | ||
swaggerSchema = require('swagger-schema-official/schema'), | ||
ZSchema = require('z-schema'); | ||
ZSchema = require('z-schema'), | ||
swaggerSchema = require('swagger-schema-official/schema'); | ||
@@ -30,3 +30,3 @@ module.exports = validateSchema; | ||
var message = 'Swagger schema validation failed. ' + formatZSchemaError(err.details); | ||
throw ono.syntax(err, message); | ||
throw ono.syntax(err, {details: err.details}, message); | ||
} | ||
@@ -39,15 +39,7 @@ } | ||
function initializeZSchema() { | ||
// Patch the Swagger schema to support "file" in addition to the JSON Schema primitives | ||
// See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#response-object | ||
swaggerSchema.definitions.schema.properties.type = { | ||
anyOf: [ | ||
{$ref: 'http://json-schema.org/draft-04/schema#/properties/type'}, | ||
{enum: ['file']} | ||
] | ||
}; | ||
ZSchema = new ZSchema({ | ||
breakOnFirstError: true, | ||
noExtraKeywords: true, | ||
ignoreUnknownFormats: false | ||
ignoreUnknownFormats: false, | ||
reportPathAsArray: true | ||
}); | ||
@@ -68,3 +60,3 @@ } | ||
errors.forEach(function(error, index) { | ||
message += util.format('\n%s%s at %s', indent, error.message, error.path); | ||
message += util.format('\n%s%s at %s', indent, error.message, error.path.join('/')); | ||
if (error.inner) { | ||
@@ -71,0 +63,0 @@ message += formatZSchemaError(error.inner, indent + ' '); |
{ | ||
"name": "swagger-parser", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "Swagger 2.0 parser and validator for Node and browsers", | ||
@@ -68,3 +68,3 @@ "keywords": [ | ||
"jscs": "^2.2.1", | ||
"eslint": "^1.5.1", | ||
"eslint": "^1.6.0", | ||
"npm-check-updates": "^2.2.4", | ||
@@ -80,5 +80,5 @@ "version-bump-prompt": "^1.5.2" | ||
"swagger-methods": "^1.0.0", | ||
"swagger-schema-official": "2.0.0-96305d9", | ||
"swagger-schema-official": "2.0.0-d79c205", | ||
"z-schema": "^3.15.2" | ||
} | ||
} |
@@ -23,3 +23,3 @@ Swagger Parser | ||
- Parses Swagger specs in **JSON** or **YAML** format | ||
- Validates against the [Swagger 2.0 schema](https://github.com/reverb/swagger-spec/blob/master/schemas/v2.0/schema.json) _and_ the [Swagger 2.0 spec](https://github.com/reverb/swagger-spec/blob/master/versions/2.0.md) | ||
- Validates against the [Swagger 2.0 schema](https://github.com/swagger-api/swagger-spec/blob/master/schemas/v2.0/schema.json) _and_ the [Swagger 2.0 spec](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md) | ||
- [Resolves](docs/swagger-parser.md#resolveapi-options-callback) all `$ref` pointers, including external files and URLs | ||
@@ -26,0 +26,0 @@ - Can [bundle](docs/swagger-parser.md#bundleapi-options-callback) all your Swagger files into a single file that only has _internal_ `$ref` pointers |
Sorry, the diff of this file is too big to display
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 not supported yet
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
3191457
26444
+ Addedswagger-schema-official@2.0.0-d79c205(transitive)
- Removedswagger-schema-official@2.0.0-96305d9(transitive)