-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83ed6f3
commit a9cc3b3
Showing
9 changed files
with
256 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore" | ||
}, | ||
"webhooks": { | ||
"myWebhook": { | ||
"$ref": "#/components/pathItems/catsWebhook", | ||
"description": "Overriding description", | ||
"summary": "Overriding summary" | ||
} | ||
}, | ||
"components": { | ||
"pathItems": { | ||
"catsWebhook": { | ||
"put": { | ||
"summary": "Get a cat details after update", | ||
"description": "Get a cat details after update", | ||
"operationId": "updatedCat", | ||
"tags": [ | ||
"pet" | ||
], | ||
"requestBody": { | ||
"description": "Information about cat in the system", | ||
"content": { | ||
"multipart/form-data": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "update Cat details" | ||
} | ||
} | ||
}, | ||
"post": { | ||
"summary": "Create new cat", | ||
"description": "Info about new cat", | ||
"operationId": "createdCat", | ||
"tags": [ | ||
"pet" | ||
], | ||
"requestBody": { | ||
"description": "Information about cat in the system", | ||
"content": { | ||
"multipart/form-data": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "create Cat details" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
import { MenuBuilder } from '../../MenuBuilder'; | ||
import { OpenAPIParser } from '../../OpenAPIParser'; | ||
|
||
import { RedocNormalizedOptions } from '../../RedocNormalizedOptions'; | ||
|
||
const opts = new RedocNormalizedOptions({}); | ||
|
||
describe('Models', () => { | ||
describe('MenuBuilder', () => { | ||
let parser; | ||
|
||
test('discriminator with one field', () => { | ||
const spec = require('../fixtures/3.1/pathItems.json'); | ||
parser = new OpenAPIParser(spec, undefined, opts); | ||
const contentItems = MenuBuilder.buildStructure(parser, opts); | ||
expect(contentItems).toHaveLength(2); | ||
expect(contentItems[0].items).toHaveLength(2); | ||
expect(contentItems[0].id).toEqual('tag/pet'); | ||
expect(contentItems[0].name).toEqual('pet'); | ||
expect(contentItems[0].type).toEqual('tag'); | ||
|
||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.