Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #121 from apiaryio/kylef/metadata
Browse files Browse the repository at this point in the history
Metadata belongs in metadata
  • Loading branch information
kylef authored Aug 21, 2017
2 parents 96e5c6e + 96850fa commit 50a901a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/circular-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"attributes": {
"meta": {
"metadata": {
"element": "array",
"content": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/invalid-media-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"attributes": {
"meta": {
"metadata": {
"element": "array",
"content": [
{
Expand Down

0 comments on commit 50a901a

Please sign in to comment.