diff --git a/CHANGELOG.md b/CHANGELOG.md index 33750dd..c1385cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Bug Fixes +- HOST metadata was incorrectly included in an attribute called `meta`. The + attribute was renamed to `metadata` in API Elements 1.0. - Fixes an issue where auth scheme elements are re-used multiple times in a parse result which can cause exceptions when the parse result is frozen. diff --git a/package.json b/package.json index 273a18d..cea7c2c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "minim": "^0.19.0", "minim-parse-result": "^0.8.0", "peasant": "^1.1.0", - "swagger-zoo": "2.5.1" + "swagger-zoo": "2.5.2" }, "engines": { "node": ">=4" diff --git a/src/parser.js b/src/parser.js index 1824dd6..078379d 100644 --- a/src/parser.js +++ b/src/parser.js @@ -348,7 +348,7 @@ export default class Parser { hostname = `${this.swagger.schemes[0]}://${hostname}`; } - const meta = []; + const metadata = []; const member = new MemberElement('HOST', hostname); member.meta.set('classes', ['user']); @@ -357,8 +357,8 @@ export default class Parser { this.createSourceMap(member, this.path); } - meta.push(member); - this.api.attributes.set('meta', meta); + metadata.push(member); + this.api.attributes.set('metadata', metadata); return member; }); diff --git a/test/fixtures/circular-example.json b/test/fixtures/circular-example.json index 762093a..7375f03 100644 --- a/test/fixtures/circular-example.json +++ b/test/fixtures/circular-example.json @@ -19,7 +19,7 @@ } }, "attributes": { - "meta": { + "metadata": { "element": "array", "content": [ { diff --git a/test/fixtures/invalid-media-type.json b/test/fixtures/invalid-media-type.json index af39c55..536b035 100644 --- a/test/fixtures/invalid-media-type.json +++ b/test/fixtures/invalid-media-type.json @@ -19,7 +19,7 @@ } }, "attributes": { - "meta": { + "metadata": { "element": "array", "content": [ {