From 6de02744b2db1b0ace1cee2ee3173c7f65d1e144 Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 16:42:55 +0300 Subject: [PATCH 1/7] fix: hide deprecated 504 responses from openapi --- schemas/paths/event.yaml | 1 + schemas/paths/events.yaml | 1 + ...moveDeprecatedResponsesTransformer.spec.ts | 70 +++++++++++++++++++ .../removeDeprecatedResponsesTransformer.ts | 22 ++++++ utils/transformers/transformSchema.ts | 11 ++- 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 utils/transformers/removeDeprecatedResponsesTransformer.spec.ts create mode 100644 utils/transformers/removeDeprecatedResponsesTransformer.ts diff --git a/schemas/paths/event.yaml b/schemas/paths/event.yaml index 0eae368e..20583e75 100644 --- a/schemas/paths/event.yaml +++ b/schemas/paths/event.yaml @@ -109,6 +109,7 @@ get: externalValue: examples/errors/500_internal_server_error.json '504': description: Gateway Timeout. Search execution exceeded the allowed timeout window. + x-deprecated-response: true content: application/json: schema: diff --git a/schemas/paths/events.yaml b/schemas/paths/events.yaml index a9a81c2f..b44dccf5 100644 --- a/schemas/paths/events.yaml +++ b/schemas/paths/events.yaml @@ -637,6 +637,7 @@ get: externalValue: examples/errors/500_internal_server_error.json '504': description: Gateway Timeout. Search execution exceeded the allowed timeout window. + x-deprecated-response: true content: application/json: schema: diff --git a/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts b/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts new file mode 100644 index 00000000..a3bd7b1c --- /dev/null +++ b/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts @@ -0,0 +1,70 @@ +import { parseYaml } from './parseYaml.ts'; +import { removeDeprecatedResponsesTransformer } from './removeDeprecatedResponsesTransformer.ts'; +import { transformSchema } from './transformSchema.ts'; + +const yamlWithDeprecatedResponses = ` +openapi: 3.1.1 +paths: + /events: + get: + responses: + '200': + description: OK + '504': + description: Gateway Timeout + x-deprecated-response: true + parameters: + - name: foo + in: query + /events/{event_id}: + get: + responses: + '200': + description: OK + '500': + description: Workspace error + x-deprecated-response: false + '504': + description: Gateway Timeout + x-deprecated-response: true + patch: + responses: + '200': + description: OK +`; + +describe('removeDeprecatedResponsesTransformer', () => { + it('removes responses marked with x-deprecated-response: true', () => { + const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); + const parsed = parseYaml(result); + + expect(Object.keys(parsed.paths['/events'].get.responses)).toEqual(['200']); + expect(Object.keys(parsed.paths['/events/{event_id}'].get.responses)).toEqual(['200', '500']); + }); + + it('keeps responses where x-deprecated-response is not true', () => { + const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); + const parsed = parseYaml(result); + + expect(parsed.paths['/events/{event_id}'].get.responses['500']['x-deprecated-response']).toBe(false); + expect(Object.keys(parsed.paths['/events/{event_id}'].patch.responses)).toEqual(['200']); + }); + + it('leaves path-level fields that are not operations untouched', () => { + const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); + const parsed = parseYaml(result); + + expect(parsed.paths['/events'].parameters).toEqual([{ name: 'foo', in: 'query' }]); + }); + + it('is a no-op when the document has no paths', () => { + const yamlWithoutPaths = ` +openapi: 3.1.1 +components: {} +`; + const result = transformSchema(yamlWithoutPaths, [removeDeprecatedResponsesTransformer]); + const parsed = parseYaml(result); + + expect(parsed).toEqual({ openapi: '3.1.1', components: {} }); + }); +}); diff --git a/utils/transformers/removeDeprecatedResponsesTransformer.ts b/utils/transformers/removeDeprecatedResponsesTransformer.ts new file mode 100644 index 00000000..c67d59cb --- /dev/null +++ b/utils/transformers/removeDeprecatedResponsesTransformer.ts @@ -0,0 +1,22 @@ +import type { OpenApiDocument } from '../openapi.ts'; + +export const DEPRECATED_RESPONSE_EXTENSION = 'x-deprecated-response'; + +// Removes responses marked with `x-deprecated-response: true` from path operations. +// Used for the docs schema only, SDK schemas keep these responses to avoid breaking changes. +export function removeDeprecatedResponsesTransformer(apiDefinition: OpenApiDocument): void { + Object.values(apiDefinition.paths ?? {}).forEach((pathItem: any) => { + Object.values(pathItem ?? {}).forEach((operation: any) => { + const responses = operation?.responses; + if (!responses || typeof responses !== 'object') { + return; + } + + Object.entries(responses).forEach(([statusCode, response]: [string, any]) => { + if (response?.[DEPRECATED_RESPONSE_EXTENSION] === true) { + delete responses[statusCode]; + } + }); + }); + }); +} diff --git a/utils/transformers/transformSchema.ts b/utils/transformers/transformSchema.ts index d2f7fad7..1f00df9f 100644 --- a/utils/transformers/transformSchema.ts +++ b/utils/transformers/transformSchema.ts @@ -6,6 +6,10 @@ import { extractFirstParameterExampleTransformer } from './extractFirstParameter import { extractPathOperationInlineEnumsTransformer } from './extractPathOperationInlineEnumsTransformer.ts'; import { parseYaml } from './parseYaml.ts'; import { removeBigExamplesTransformer } from './removeBigExamplesTransformer.ts'; +import { + DEPRECATED_RESPONSE_EXTENSION, + removeDeprecatedResponsesTransformer, +} from './removeDeprecatedResponsesTransformer.ts'; import { removeEdgeTransformer } from './removeEdgeTransformer.ts'; import { removeFeedbackTransformer } from './removeFeedbackTransformer.ts'; import { removeWebhookTransformer } from './removeWebhookTransformer.ts'; @@ -39,12 +43,17 @@ export const v4CommonTransformers: Transformer[] = [ export const v4Transformers: Transformer[] = [ ...v4CommonTransformers, + // Hide deprecated responses from the docs. SDK schemas keep them to avoid breaking changes. + removeDeprecatedResponsesTransformer, // This transformer should run last to ensure all unused schemas are found removeUnusedSchemasTransformer, ]; export const v4SchemaForSdksCommonTransformers: Transformer[] = [ - ...v4Transformers, + ...v4CommonTransformers, + // Keep deprecated responses in SDK schemas, only drop the docs-specific marker + removeFieldTransformer(DEPRECATED_RESPONSE_EXTENSION), + removeUnusedSchemasTransformer, extractFirstParameterExampleTransformer, removeEdgeTransformer, removeFeedbackTransformer, From 715cd0afdf6e10d36e0b04778d950385d1de597e Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 16:49:29 +0300 Subject: [PATCH 2/7] test: tests are not in isolation for 504 deprecation transformer --- utils/transformers/transformSchema.spec.ts | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/utils/transformers/transformSchema.spec.ts b/utils/transformers/transformSchema.spec.ts index 7dcde8d2..da94b6e4 100644 --- a/utils/transformers/transformSchema.spec.ts +++ b/utils/transformers/transformSchema.spec.ts @@ -150,6 +150,75 @@ describe('Test transformSchema pipelines for v4', () => { } }); + it('v4 docs schema removes responses marked with x-deprecated-response', () => { + const yamlWithDeprecatedResponse = toYaml({ + openapi: '3.1.1', + paths: { + '/events': { + get: { + responses: { + '200': { description: 'OK' }, + '504': { description: 'Gateway Timeout', 'x-deprecated-response': true }, + }, + }, + }, + }, + components: { schemas: {} }, + }); + + const result = transformSchema(yamlWithDeprecatedResponse, [...v4Transformers]); + const parsed = parseYaml(result); + + expect(Object.keys(parsed.paths['/events'].get.responses)).toEqual(['200']); + }); + + it('v4 sdk schemas keep responses marked with x-deprecated-response and strip the marker', () => { + const yamlWithDeprecatedResponse = toYaml({ + openapi: '3.1.1', + paths: { + '/events': { + get: { + responses: { + '200': { description: 'OK' }, + '504': { description: 'Gateway Timeout', 'x-deprecated-response': true }, + }, + }, + }, + }, + components: { schemas: {} }, + }); + + for (const transformers of [v4SchemaForSdksTransformers, v4SchemaForSdksNormalizedTransformers]) { + const result = transformSchema(yamlWithDeprecatedResponse, transformers); + const parsed = parseYaml(result); + + expect(parsed.paths['/events'].get.responses['504']).toEqual({ description: 'Gateway Timeout' }); + expect(hasYamlKey(result, 'x-deprecated-response')).toBe(false); + } + }); + + it('v4 deprecated 504 responses are removed from the docs schema and kept in sdk schemas', () => { + const operations = [ + ['/events', 'get'], + ['/events/{event_id}', 'get'], + ] as const; + + const docs = parseYaml(transformSchema(v4Schema, v4Transformers)); + for (const [path, method] of operations) { + expect(docs.paths[path][method].responses['504']).toBeUndefined(); + } + + for (const transformers of [v4SchemaForSdksTransformers, v4SchemaForSdksNormalizedTransformers]) { + const result = transformSchema(v4Schema, transformers); + const parsed = parseYaml(result); + + for (const [path, method] of operations) { + expect(parsed.paths[path][method].responses['504']).toBeDefined(); + } + expect(hasYamlKey(result, 'x-deprecated-response')).toBe(false); + } + }); + it('v4 normalized sdk schema removes response examples, additionalProperties: false, oneOf query parameters while keeping schema examples', () => { const result = transformSchema(v4Schema, v4SchemaForSdksNormalizedTransformers); From ea0c7bd4093046d0840533f40a6daf7023c310d1 Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 17:34:27 +0300 Subject: [PATCH 3/7] chore: remove x-deprecated-response flags --- schemas/paths/event.yaml | 1 - schemas/paths/events.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/schemas/paths/event.yaml b/schemas/paths/event.yaml index 20583e75..0eae368e 100644 --- a/schemas/paths/event.yaml +++ b/schemas/paths/event.yaml @@ -109,7 +109,6 @@ get: externalValue: examples/errors/500_internal_server_error.json '504': description: Gateway Timeout. Search execution exceeded the allowed timeout window. - x-deprecated-response: true content: application/json: schema: diff --git a/schemas/paths/events.yaml b/schemas/paths/events.yaml index b44dccf5..a9a81c2f 100644 --- a/schemas/paths/events.yaml +++ b/schemas/paths/events.yaml @@ -637,7 +637,6 @@ get: externalValue: examples/errors/500_internal_server_error.json '504': description: Gateway Timeout. Search execution exceeded the allowed timeout window. - x-deprecated-response: true content: application/json: schema: From 92b2d4cdb5a4d648d5247ce0ce8e50b1c85ddd31 Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 17:34:27 +0300 Subject: [PATCH 4/7] fix: keep x-deprecated-response in sdk schemas --- utils/transformers/removeDeprecatedResponsesTransformer.ts | 2 +- utils/transformers/transformSchema.ts | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/utils/transformers/removeDeprecatedResponsesTransformer.ts b/utils/transformers/removeDeprecatedResponsesTransformer.ts index c67d59cb..1b4eff58 100644 --- a/utils/transformers/removeDeprecatedResponsesTransformer.ts +++ b/utils/transformers/removeDeprecatedResponsesTransformer.ts @@ -1,6 +1,6 @@ import type { OpenApiDocument } from '../openapi.ts'; -export const DEPRECATED_RESPONSE_EXTENSION = 'x-deprecated-response'; +const DEPRECATED_RESPONSE_EXTENSION = 'x-deprecated-response'; // Removes responses marked with `x-deprecated-response: true` from path operations. // Used for the docs schema only, SDK schemas keep these responses to avoid breaking changes. diff --git a/utils/transformers/transformSchema.ts b/utils/transformers/transformSchema.ts index 1f00df9f..0d2ddad4 100644 --- a/utils/transformers/transformSchema.ts +++ b/utils/transformers/transformSchema.ts @@ -6,10 +6,7 @@ import { extractFirstParameterExampleTransformer } from './extractFirstParameter import { extractPathOperationInlineEnumsTransformer } from './extractPathOperationInlineEnumsTransformer.ts'; import { parseYaml } from './parseYaml.ts'; import { removeBigExamplesTransformer } from './removeBigExamplesTransformer.ts'; -import { - DEPRECATED_RESPONSE_EXTENSION, - removeDeprecatedResponsesTransformer, -} from './removeDeprecatedResponsesTransformer.ts'; +import { removeDeprecatedResponsesTransformer } from './removeDeprecatedResponsesTransformer.ts'; import { removeEdgeTransformer } from './removeEdgeTransformer.ts'; import { removeFeedbackTransformer } from './removeFeedbackTransformer.ts'; import { removeWebhookTransformer } from './removeWebhookTransformer.ts'; @@ -51,8 +48,6 @@ export const v4Transformers: Transformer[] = [ export const v4SchemaForSdksCommonTransformers: Transformer[] = [ ...v4CommonTransformers, - // Keep deprecated responses in SDK schemas, only drop the docs-specific marker - removeFieldTransformer(DEPRECATED_RESPONSE_EXTENSION), removeUnusedSchemasTransformer, extractFirstParameterExampleTransformer, removeEdgeTransformer, From 3a94304e3e27fcae2284e8e5313de3520340fd68 Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 17:34:27 +0300 Subject: [PATCH 5/7] test: use mocks for deprecated responses transformer --- .../mocks/schemaWithDeprecatedResponses.yaml | 53 +++++++++++++ .../schemaWithDeprecatedResponsesRemoved.yaml | 40 ++++++++++ ...moveDeprecatedResponsesTransformer.spec.ts | 74 ++++--------------- 3 files changed, 106 insertions(+), 61 deletions(-) create mode 100644 utils/mocks/schemaWithDeprecatedResponses.yaml create mode 100644 utils/mocks/schemaWithDeprecatedResponsesRemoved.yaml diff --git a/utils/mocks/schemaWithDeprecatedResponses.yaml b/utils/mocks/schemaWithDeprecatedResponses.yaml new file mode 100644 index 00000000..4d6a6ece --- /dev/null +++ b/utils/mocks/schemaWithDeprecatedResponses.yaml @@ -0,0 +1,53 @@ +openapi: 3.1.1 +info: + title: test + version: '1.0' +paths: + /v4/events: + parameters: + # Path-level parameters are not operations and should remain untouched + - name: x-region + in: header + required: false + schema: + type: string + get: + operationId: searchEvents + responses: + '200': + description: OK + '500': + description: Workspace error + # Deprecated response should be removed + '504': + description: Gateway Timeout + x-deprecated-response: true + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /v4/events/{event_id}: + get: + operationId: getEvent + responses: + '200': + description: OK + # Responses not explicitly marked as deprecated should remain + '500': + description: Workspace error + x-deprecated-response: false + '504': + description: Gateway Timeout + x-deprecated-response: true + patch: + operationId: updateEvent + responses: + '200': + description: OK +components: + schemas: + ErrorResponse: + type: object + properties: + error: + type: string diff --git a/utils/mocks/schemaWithDeprecatedResponsesRemoved.yaml b/utils/mocks/schemaWithDeprecatedResponsesRemoved.yaml new file mode 100644 index 00000000..5240744e --- /dev/null +++ b/utils/mocks/schemaWithDeprecatedResponsesRemoved.yaml @@ -0,0 +1,40 @@ +openapi: 3.1.1 +info: + title: test + version: '1.0' +paths: + /v4/events: + parameters: + - name: x-region + in: header + required: false + schema: + type: string + get: + operationId: searchEvents + responses: + '200': + description: OK + '500': + description: Workspace error + /v4/events/{event_id}: + get: + operationId: getEvent + responses: + '200': + description: OK + '500': + description: Workspace error + x-deprecated-response: false + patch: + operationId: updateEvent + responses: + '200': + description: OK +components: + schemas: + ErrorResponse: + type: object + properties: + error: + type: string diff --git a/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts b/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts index a3bd7b1c..c07e500a 100644 --- a/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts +++ b/utils/transformers/removeDeprecatedResponsesTransformer.spec.ts @@ -1,70 +1,22 @@ -import { parseYaml } from './parseYaml.ts'; +import fs from 'fs'; import { removeDeprecatedResponsesTransformer } from './removeDeprecatedResponsesTransformer.ts'; import { transformSchema } from './transformSchema.ts'; -const yamlWithDeprecatedResponses = ` -openapi: 3.1.1 -paths: - /events: - get: - responses: - '200': - description: OK - '504': - description: Gateway Timeout - x-deprecated-response: true - parameters: - - name: foo - in: query - /events/{event_id}: - get: - responses: - '200': - description: OK - '500': - description: Workspace error - x-deprecated-response: false - '504': - description: Gateway Timeout - x-deprecated-response: true - patch: - responses: - '200': - description: OK -`; +const simpleYaml = fs.readFileSync('./utils/mocks/simple.yaml'); +const schemaWithDeprecatedResponses = fs.readFileSync('./utils/mocks/schemaWithDeprecatedResponses.yaml'); +const schemaWithDeprecatedResponsesRemoved = fs.readFileSync('./utils/mocks/schemaWithDeprecatedResponsesRemoved.yaml'); -describe('removeDeprecatedResponsesTransformer', () => { - it('removes responses marked with x-deprecated-response: true', () => { - const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); - const parsed = parseYaml(result); +const removeDeprecatedResponses = (yaml: string | Buffer) => + transformSchema(yaml, [removeDeprecatedResponsesTransformer]); - expect(Object.keys(parsed.paths['/events'].get.responses)).toEqual(['200']); - expect(Object.keys(parsed.paths['/events/{event_id}'].get.responses)).toEqual(['200', '500']); +describe('Test removeDeprecatedResponsesTransformer', () => { + it('does not modify schema without deprecated responses', () => { + const result = removeDeprecatedResponses(simpleYaml); + expect(result.toString()).toEqual(simpleYaml.toString()); }); - it('keeps responses where x-deprecated-response is not true', () => { - const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); - const parsed = parseYaml(result); - - expect(parsed.paths['/events/{event_id}'].get.responses['500']['x-deprecated-response']).toBe(false); - expect(Object.keys(parsed.paths['/events/{event_id}'].patch.responses)).toEqual(['200']); - }); - - it('leaves path-level fields that are not operations untouched', () => { - const result = transformSchema(yamlWithDeprecatedResponses, [removeDeprecatedResponsesTransformer]); - const parsed = parseYaml(result); - - expect(parsed.paths['/events'].parameters).toEqual([{ name: 'foo', in: 'query' }]); - }); - - it('is a no-op when the document has no paths', () => { - const yamlWithoutPaths = ` -openapi: 3.1.1 -components: {} -`; - const result = transformSchema(yamlWithoutPaths, [removeDeprecatedResponsesTransformer]); - const parsed = parseYaml(result); - - expect(parsed).toEqual({ openapi: '3.1.1', components: {} }); + it('removes responses marked with x-deprecated-response: true', () => { + const result = removeDeprecatedResponses(schemaWithDeprecatedResponses); + expect(result.toString()).toEqual(schemaWithDeprecatedResponsesRemoved.toString()); }); }); From 3cca1ed4195f60fbea84e9a5cade92491a0f8eea Mon Sep 17 00:00:00 2001 From: Orkun Date: Fri, 2 Oct 2026 17:34:28 +0300 Subject: [PATCH 6/7] test: remove deprecated responses pipeline tests --- utils/transformers/transformSchema.spec.ts | 69 ---------------------- 1 file changed, 69 deletions(-) diff --git a/utils/transformers/transformSchema.spec.ts b/utils/transformers/transformSchema.spec.ts index da94b6e4..7dcde8d2 100644 --- a/utils/transformers/transformSchema.spec.ts +++ b/utils/transformers/transformSchema.spec.ts @@ -150,75 +150,6 @@ describe('Test transformSchema pipelines for v4', () => { } }); - it('v4 docs schema removes responses marked with x-deprecated-response', () => { - const yamlWithDeprecatedResponse = toYaml({ - openapi: '3.1.1', - paths: { - '/events': { - get: { - responses: { - '200': { description: 'OK' }, - '504': { description: 'Gateway Timeout', 'x-deprecated-response': true }, - }, - }, - }, - }, - components: { schemas: {} }, - }); - - const result = transformSchema(yamlWithDeprecatedResponse, [...v4Transformers]); - const parsed = parseYaml(result); - - expect(Object.keys(parsed.paths['/events'].get.responses)).toEqual(['200']); - }); - - it('v4 sdk schemas keep responses marked with x-deprecated-response and strip the marker', () => { - const yamlWithDeprecatedResponse = toYaml({ - openapi: '3.1.1', - paths: { - '/events': { - get: { - responses: { - '200': { description: 'OK' }, - '504': { description: 'Gateway Timeout', 'x-deprecated-response': true }, - }, - }, - }, - }, - components: { schemas: {} }, - }); - - for (const transformers of [v4SchemaForSdksTransformers, v4SchemaForSdksNormalizedTransformers]) { - const result = transformSchema(yamlWithDeprecatedResponse, transformers); - const parsed = parseYaml(result); - - expect(parsed.paths['/events'].get.responses['504']).toEqual({ description: 'Gateway Timeout' }); - expect(hasYamlKey(result, 'x-deprecated-response')).toBe(false); - } - }); - - it('v4 deprecated 504 responses are removed from the docs schema and kept in sdk schemas', () => { - const operations = [ - ['/events', 'get'], - ['/events/{event_id}', 'get'], - ] as const; - - const docs = parseYaml(transformSchema(v4Schema, v4Transformers)); - for (const [path, method] of operations) { - expect(docs.paths[path][method].responses['504']).toBeUndefined(); - } - - for (const transformers of [v4SchemaForSdksTransformers, v4SchemaForSdksNormalizedTransformers]) { - const result = transformSchema(v4Schema, transformers); - const parsed = parseYaml(result); - - for (const [path, method] of operations) { - expect(parsed.paths[path][method].responses['504']).toBeDefined(); - } - expect(hasYamlKey(result, 'x-deprecated-response')).toBe(false); - } - }); - it('v4 normalized sdk schema removes response examples, additionalProperties: false, oneOf query parameters while keeping schema examples', () => { const result = transformSchema(v4Schema, v4SchemaForSdksNormalizedTransformers); From 23c5d397dd716c68c93d454f0b915ddfe282fd33 Mon Sep 17 00:00:00 2001 From: Orkun <5910168+Orkuncakilkaya@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:46:28 +0300 Subject: [PATCH 7/7] refactor: remove redundant comment Co-authored-by: Dan McNulty <212590662+mcnulty-fp@users.noreply.github.com> --- utils/transformers/removeDeprecatedResponsesTransformer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/transformers/removeDeprecatedResponsesTransformer.ts b/utils/transformers/removeDeprecatedResponsesTransformer.ts index 1b4eff58..3eebdaed 100644 --- a/utils/transformers/removeDeprecatedResponsesTransformer.ts +++ b/utils/transformers/removeDeprecatedResponsesTransformer.ts @@ -3,7 +3,6 @@ import type { OpenApiDocument } from '../openapi.ts'; const DEPRECATED_RESPONSE_EXTENSION = 'x-deprecated-response'; // Removes responses marked with `x-deprecated-response: true` from path operations. -// Used for the docs schema only, SDK schemas keep these responses to avoid breaking changes. export function removeDeprecatedResponsesTransformer(apiDefinition: OpenApiDocument): void { Object.values(apiDefinition.paths ?? {}).forEach((pathItem: any) => { Object.values(pathItem ?? {}).forEach((operation: any) => {