mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
feat: add webhooks supporting
This commit is contained in:
parent
c342f6f0f5
commit
17d05667af
|
@ -6,7 +6,7 @@ describe('Menu', () => {
|
|||
it('should have valid items count', () => {
|
||||
cy.get('.menu-content')
|
||||
.find('li')
|
||||
.should('have.length', 33);
|
||||
.should('have.length', 34);
|
||||
});
|
||||
|
||||
it('should sync active menu items while scroll', () => {
|
||||
|
|
|
@ -217,15 +217,18 @@ export class MenuBuilder {
|
|||
*/
|
||||
static getTagsWithOperations(spec: OpenAPISpec): TagsInfoMap {
|
||||
const tags: TagsInfoMap = {};
|
||||
const webhooks = spec['x-webhooks'] || spec.webhooks;
|
||||
for (const tag of spec.tags || []) {
|
||||
tags[tag.name] = { ...tag, operations: [] };
|
||||
}
|
||||
|
||||
if (webhooks) {
|
||||
getTags(webhooks, true);
|
||||
}
|
||||
|
||||
if (spec.paths){
|
||||
getTags(spec.paths);
|
||||
}
|
||||
if (spec.webhooks) {
|
||||
getTags(spec.webhooks, true);
|
||||
}
|
||||
|
||||
function getTags(paths: OpenAPIPaths, isWebhook?: boolean) {
|
||||
for (const pathName of Object.keys(paths)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user