mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 05:10:20 +03:00
fix: actualize naming
This commit is contained in:
parent
5fa68a1c9d
commit
02c57403db
|
@ -14,7 +14,7 @@ describe('Models', () => {
|
|||
defaultAsError: false,
|
||||
infoOrRef: {},
|
||||
options: opts,
|
||||
reverseEventsReadWriteProps: false,
|
||||
isEvent: false,
|
||||
code: 'default',
|
||||
};
|
||||
});
|
||||
|
|
|
@ -76,7 +76,7 @@ export class OperationModel implements IMenuItem {
|
|||
extensions: Record<string, any>;
|
||||
isCallback: boolean;
|
||||
isWebhook: boolean;
|
||||
reverseEventsReadWriteProps: boolean;
|
||||
isEvent: boolean;
|
||||
|
||||
constructor(
|
||||
private parser: OpenAPIParser,
|
||||
|
@ -100,7 +100,7 @@ export class OperationModel implements IMenuItem {
|
|||
this.path = operationSpec.pathName;
|
||||
this.isCallback = isCallback;
|
||||
this.isWebhook = operationSpec.isWebhook;
|
||||
this.reverseEventsReadWriteProps = this.isCallback || this.isWebhook;
|
||||
this.isEvent = this.isCallback || this.isWebhook;
|
||||
|
||||
this.name = getOperationSummary(operationSpec);
|
||||
|
||||
|
@ -177,7 +177,7 @@ export class OperationModel implements IMenuItem {
|
|||
parser: this.parser,
|
||||
infoOrRef: this.operationSpec.requestBody,
|
||||
options: this.options,
|
||||
reverseEventsReadWriteProps: this.reverseEventsReadWriteProps,
|
||||
isEvent: this.isEvent,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ export class OperationModel implements IMenuItem {
|
|||
defaultAsError: hasSuccessResponses,
|
||||
infoOrRef: this.operationSpec.responses[code],
|
||||
options: this.options,
|
||||
reverseEventsReadWriteProps: this.reverseEventsReadWriteProps,
|
||||
isEvent: this.isEvent,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ type RequestBodyProps = {
|
|||
parser: OpenAPIParser;
|
||||
infoOrRef: Referenced<OpenAPIRequestBody>;
|
||||
options: RedocNormalizedOptions;
|
||||
reverseEventsReadWriteProps: boolean;
|
||||
isEvent: boolean;
|
||||
}
|
||||
|
||||
export class RequestBodyModel {
|
||||
|
@ -17,8 +17,8 @@ export class RequestBodyModel {
|
|||
content?: MediaContentModel;
|
||||
|
||||
constructor(props: RequestBodyProps) {
|
||||
const { parser, infoOrRef, options, reverseEventsReadWriteProps } = props;
|
||||
const isRequest = reverseEventsReadWriteProps ? false : true;
|
||||
const { parser, infoOrRef, options, isEvent } = props;
|
||||
const isRequest = isEvent ? false : true;
|
||||
const info = parser.deref(infoOrRef);
|
||||
this.description = info.description || '';
|
||||
this.required = !!info.required;
|
||||
|
|
|
@ -14,7 +14,7 @@ type ResponseProps = {
|
|||
defaultAsError: boolean,
|
||||
infoOrRef: Referenced<OpenAPIResponse>,
|
||||
options: RedocNormalizedOptions,
|
||||
reverseEventsReadWriteProps: boolean,
|
||||
isEvent: boolean,
|
||||
}
|
||||
|
||||
export class ResponseModel {
|
||||
|
@ -29,8 +29,8 @@ export class ResponseModel {
|
|||
headers: FieldModel[] = [];
|
||||
|
||||
constructor(props: ResponseProps) {
|
||||
const { parser, code, defaultAsError, infoOrRef, options, reverseEventsReadWriteProps } = props;
|
||||
const isRequest = reverseEventsReadWriteProps ? true : false;
|
||||
const { parser, code, defaultAsError, infoOrRef, options, isEvent } = props;
|
||||
const isRequest = isEvent ? true : false;
|
||||
makeObservable(this);
|
||||
|
||||
this.expanded = options.expandResponses === 'all' || options.expandResponses[code];
|
||||
|
|
Loading…
Reference in New Issue
Block a user