Skip to content

Commit 4f4553d

Browse files
committed
Revert error response stripping — keep full responses
Error status codes (401, 403, 404) are useful for agents to debug failures. The agent should filter fields selectively, not have data hidden from it.
1 parent 7300451 commit 4f4553d

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@ export function processSpec(
128128
for (const method of HTTP_METHODS) {
129129
const op = pathItem[method];
130130
if (op) {
131-
// Only keep success responses (2xx) — error schemas are redundant noise
132-
const successResponses: Record<string, unknown> = {};
133-
if (op.responses) {
134-
for (const [status, resp] of Object.entries(op.responses)) {
135-
if (status.startsWith("2") || status === "default") {
136-
successResponses[status] = resp;
137-
}
138-
}
139-
}
140-
141131
paths[fullPath][method] = {
142132
summary: op.summary,
143133
description: op.description,
@@ -155,7 +145,7 @@ export function processSpec(
155145
maxRefDepth,
156146
),
157147
responses: resolveRefs(
158-
Object.keys(successResponses).length > 0 ? successResponses : op.responses,
148+
op.responses,
159149
spec as Record<string, unknown>,
160150
undefined,
161151
maxRefDepth,

0 commit comments

Comments
 (0)