asyncapi-parser
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -189,2 +189,11 @@ const { addExtensions } = require('../utils'); | ||
/** | ||
* @returns {Schema} | ||
*/ | ||
additionalItems() { | ||
const ai = this._json.additionalItems; | ||
if (ai === undefined || ai === null) return; | ||
return new Schema(ai); | ||
} | ||
/** | ||
* @returns {Object<string, Schema>} | ||
@@ -191,0 +200,0 @@ */ |
{ | ||
"name": "asyncapi-parser", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "JavaScript AsyncAPI parser.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -271,2 +271,23 @@ const { expect } = require('chai'); | ||
describe('#additionalItems()', function () { | ||
it('should return a Schema object', () => { | ||
const doc = { "additionalItems": { "type": "string" } }; | ||
const d = new Schema(doc); | ||
expect(d.additionalItems().constructor.name).to.be.equal('Schema'); | ||
expect(d.additionalItems().json()).to.be.equal(doc.additionalItems); | ||
}); | ||
it('should return undefined when not defined', () => { | ||
const doc = {}; | ||
const d = new Schema(doc); | ||
expect(d.additionalItems()).to.be.equal(undefined); | ||
}); | ||
it('should return undefined when null', () => { | ||
const doc = { additionalItems: null }; | ||
const d = new Schema(doc); | ||
expect(d.additionalItems()).to.be.equal(undefined); | ||
}); | ||
}); | ||
describe('#patternProperties()', function () { | ||
@@ -273,0 +294,0 @@ it('should return a map of Schema objects', () => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
779676
5847