mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-29 17:40:05 +03:00
feat(): Expose certain extensions
This commit is contained in:
parent
e96e9d85c4
commit
aa159377d5
|
@ -25,6 +25,7 @@ import type { OpenAPIParser } from '../OpenAPIParser';
|
||||||
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
||||||
import type { MediaContentModel } from './MediaContent';
|
import type { MediaContentModel } from './MediaContent';
|
||||||
import type { ContentItemModel, ExtendedOpenAPIOperation, IMenuItem } from '../types';
|
import type { ContentItemModel, ExtendedOpenAPIOperation, IMenuItem } from '../types';
|
||||||
|
import { MilesConstants } from '../../types';
|
||||||
|
|
||||||
export interface XPayloadSample {
|
export interface XPayloadSample {
|
||||||
lang: 'payload';
|
lang: 'payload';
|
||||||
|
@ -80,6 +81,8 @@ export class OperationModel implements IMenuItem {
|
||||||
isWebhook: boolean;
|
isWebhook: boolean;
|
||||||
isEvent: boolean;
|
isEvent: boolean;
|
||||||
|
|
||||||
|
extraDescription: Record<string, boolean>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private parser: OpenAPIParser,
|
private parser: OpenAPIParser,
|
||||||
private operationSpec: ExtendedOpenAPIOperation,
|
private operationSpec: ExtendedOpenAPIOperation,
|
||||||
|
@ -135,6 +138,12 @@ export class OperationModel implements IMenuItem {
|
||||||
security => new SecurityRequirementModel(security, parser),
|
security => new SecurityRequirementModel(security, parser),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (operationSpec[MilesConstants.MILES_EXTRA_DESCRIPTION_PROPERTY_NAME] == undefined) {
|
||||||
|
this.extraDescription = operationSpec.extraDescription;
|
||||||
|
} else {
|
||||||
|
this.extraDescription = operationSpec[MilesConstants.MILES_EXTRA_DESCRIPTION_PROPERTY_NAME];
|
||||||
|
}
|
||||||
|
|
||||||
this.servers = normalizeServers(
|
this.servers = normalizeServers(
|
||||||
parser.specUrl,
|
parser.specUrl,
|
||||||
operationSpec.servers || operationSpec.pathServers || parser.spec.servers || [],
|
operationSpec.servers || operationSpec.pathServers || parser.spec.servers || [],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user