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

support root extensions #177

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export default class Parser {
this.handleSwaggerInfo();
this.handleSwaggerHost();
this.handleSwaggerAuth();
this.handleSwaggerVendorExtensions(this.api, this.swagger);

this.handleExternalDocs(this.api, swagger.externalDocs);

Expand Down
77 changes: 77 additions & 0 deletions test/fixtures/root-extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"element": "parseResult",
"content": [
{
"element": "category",
"meta": {
"classes": {
"element": "array",
"content": [
{
"element": "string",
"content": "api"
}
]
},
"title": {
"element": "string",
"content": "Root Extensions"
}
},
"content": [
{
"element": "extension",
"meta": {
"links": {
"element": "array",
"content": [
{
"element": "link",
"attributes": {
"relation": {
"element": "string",
"content": "profile"
},
"href": {
"element": "string",
"content": "https://help.apiary.io/profiles/api-elements/vendor-extensions/"
}
}
}
]
}
},
"content": {
"x-info-extension": "Info Extension"
}
},
{
"element": "extension",
"meta": {
"links": {
"element": "array",
"content": [
{
"element": "link",
"attributes": {
"relation": {
"element": "string",
"content": "profile"
},
"href": {
"element": "string",
"content": "https://help.apiary.io/profiles/api-elements/vendor-extensions/"
}
}
}
]
}
},
"content": {
"x-root-extension": "Root Extension"
}
}
]
}
]
}
6 changes: 6 additions & 0 deletions test/fixtures/root-extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
swagger: '2.0'
info:
version: 1.0.0
title: Root Extensions
x-info-extension: Info Extension
x-root-extension: Root Extension