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