+ {/* Accordion Trigger */}
+
+
+ {/* Accordion Content */}
+ {isExpanded && (
+
+ {/* Operation ID */}
+ {endpoint.operation.operationId && (
+
+ operationId: {endpoint.operation.operationId}
+
+ )}
+
+ {/* Description */}
+ {endpoint.operation.description && (
+
+ {endpoint.operation.description}
+
+ )}
+
+
+ {/* Copy Path Helper */}
+
+
+ Endpoint Path: {endpoint.path}
+
+
+
+
+ {/* Parameters */}
+ {endpoint.operation.parameters &&
+ endpoint.operation.parameters.length > 0 && (
+
+
+ Parameters
+
+
+
+
+
+ | Name |
+ Located In |
+ Type |
+ Required |
+ Description |
+
+
+
+ {endpoint.operation.parameters.map((param: any, pIdx: number) => (
+
+ |
+ {param.name}
+ |
+
+ {param.in}
+ |
+
+ {param.schema?.type || "any"}
+ |
+
+ {param.required ? (
+
+ yes
+
+ ) : (
+ no
+ )}
+ |
+
+ {param.description}
+ |
+
+ ))}
+
+
+
+
+ )}
+
+ {/* Request Body */}
+ {endpoint.operation.requestBody && (
+
+
+ Request Body
+
+ {endpoint.operation.requestBody.description && (
+
+ {endpoint.operation.requestBody.description}
+
+ )}
+ {Object.entries(endpoint.operation.requestBody.content || {}).map(
+ ([mediaType, contentObj]: [string, any]) => (
+
+
+ {mediaType}
+
+ {contentObj.schema && (
+
+
+
+ )}
+
+ )
+ )}
+
+ )}
+
+ {/* Responses */}
+ {endpoint.operation.responses && (
+
+
+ Responses
+
+
+ {Object.entries(endpoint.operation.responses).map(
+ ([statusCode, responseObj]: [string, any]) => {
+ const isSuccess = statusCode.startsWith("2");
+ const isError = statusCode.startsWith("4") || statusCode.startsWith("5");
+ let codeBadge =
+ "px-2 py-0.5 text-xs font-bold rounded-md font-mono border ";
+ if (isSuccess) {
+ codeBadge += "text-emerald-500 bg-emerald-500/10 border-emerald-500/20";
+ } else if (isError) {
+ codeBadge += "text-rose-500 bg-rose-500/10 border-rose-500/20";
+ } else {
+ codeBadge += "text-secondary bg-elevated border-border";
+ }
+
+ return (
+
+
+ {statusCode}
+
+ {responseObj.description}
+
+
+
+ {responseObj.content &&
+ Object.entries(responseObj.content).map(
+ ([resMediaType, resContentObj]: [string, any]) => (
+
+
+ {resMediaType}
+
+ {resContentObj.schema && (
+
+
+
+ )}
+
+ )
+ )}
+
+ );
+ }
+ )}
+
+
+ )}
+
+ {/* Mock Curl Command */}
+
+
+
+ Mock Curl Request
+
+
+
+
+
+ {curlCommand}
+
+
+
+ )
+ }
+