open-api-mocker
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -9,2 +9,9 @@ # Changelog | ||
## [1.3.0] - 2020-04-05 | ||
### Added | ||
- Support for strings in schemas with format `"password"` | ||
### Fixed | ||
- Empty response bodies are now handled properly | ||
## [1.2.5] - 2020-03-26 | ||
@@ -11,0 +18,0 @@ ### Fixed |
@@ -223,3 +223,3 @@ 'use strict'; | ||
headers: headers && this.generateResponseHeaders(headers), | ||
body: ResponseGenerator.generate(schema) | ||
body: schema ? ResponseGenerator.generate(schema) : null | ||
}; | ||
@@ -237,3 +237,3 @@ } | ||
const [responseContent] = Object.values(preferredResponse.content); | ||
const [responseContent] = Object.values(preferredResponse.content || {}); | ||
@@ -246,3 +246,3 @@ return { statusCode, schema: responseContent, headers: preferredResponse.headers }; | ||
const [[statusCode, firstResponse]] = Object.entries(this.responses); | ||
const [firstResponseContent] = Object.values(firstResponse.content); | ||
const [firstResponseContent] = Object.values(firstResponse.content || {}); | ||
@@ -249,0 +249,0 @@ return { statusCode, schema: firstResponseContent, headers: firstResponse.headers }; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const ajv = new Ajv(); | ||
const ajv = new Ajv({ unknownFormats: ['password'] }); | ||
@@ -8,0 +8,0 @@ class SchemaValidator { |
{ | ||
"name": "open-api-mocker", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"description": "A mock server based in Open API Specification", | ||
@@ -5,0 +5,0 @@ "main": "lib/open-api-mocker.js", |
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
45268