{
return (
- Responses
+ {isCallback ? 'Callback responses' : 'Responses'}
{responses.map(response => {
return ;
})}
diff --git a/src/components/__tests__/Callbacks.test.tsx b/src/components/__tests__/Callbacks.test.tsx
index 0f8cb390..added1da 100644
--- a/src/components/__tests__/Callbacks.test.tsx
+++ b/src/components/__tests__/Callbacks.test.tsx
@@ -31,7 +31,7 @@ describe('Components', () => {
it('should correctly render CallbackTitle', () => {
const callbackTitleViewElement = shallow(
- ,
+ ,
).getElement();
expect(callbackTitleViewElement.props).toBeDefined();
expect(callbackTitleViewElement.props.className).toEqual('.test');
diff --git a/src/services/models/Callback.ts b/src/services/models/Callback.ts
index 1a60ed3a..bbb04d37 100644
--- a/src/services/models/Callback.ts
+++ b/src/services/models/Callback.ts
@@ -39,7 +39,6 @@ export class CallbackModel {
undefined,
options,
true,
- this.name,
);
this.operations.push(operation);
diff --git a/src/services/models/Operation.ts b/src/services/models/Operation.ts
index b5cf136c..9b468d70 100644
--- a/src/services/models/Operation.ts
+++ b/src/services/models/Operation.ts
@@ -86,7 +86,6 @@ export class OperationModel implements IMenuItem {
parent: GroupModel | undefined,
private options: RedocNormalizedOptions,
isCallback: boolean = false,
- callbackEventName?: string,
) {
this.pointer = JsonPointer.compile(['paths', operationSpec.pathName, operationSpec.httpVerb]);
@@ -112,22 +111,21 @@ export class OperationModel implements IMenuItem {
JsonPointer.compile(['paths', operationSpec.pathName]),
);
+ this.name = getOperationSummary(operationSpec);
+
if (this.isCallback) {
- // NOTE: Use callback's event name as the view label, not the operationID.
- this.name = callbackEventName || getOperationSummary(operationSpec);
// NOTE: Callbacks by default should not inherit the specification's global `security` definition.
// Can be defined individually per-callback in the specification. Defaults to none.
this.security = (operationSpec.security || []).map(
security => new SecurityRequirementModel(security, parser),
);
- // TODO: update getting pathInfo
+ // TODO: update getting pathInfo for overriding servers on path level
this.servers = normalizeServers(
'',
operationSpec.servers || (pathInfo && pathInfo.servers) || [],
);
} else {
- this.name = getOperationSummary(operationSpec);
this.security = (operationSpec.security || parser.spec.security || []).map(
security => new SecurityRequirementModel(security, parser),
);
@@ -256,6 +254,7 @@ export class OperationModel implements IMenuItem {
@memoize
get callbacks() {
+ console.log('this.operationSpec.callbacks', this.operationSpec.callbacks);
return Object.keys(this.operationSpec.callbacks || []).map(callbackEventName => {
return new CallbackModel(
this.parser,