From 7e1191dd9290df4d054c59af0682492c7d822e59 Mon Sep 17 00:00:00 2001 From: jsklan Date: Fri, 19 Jun 2026 15:34:50 -0400 Subject: [PATCH] fix: type listAwayStatusReasons response as list wrapper The GET /away_status_reasons 200 response is modeled as a bare AwayStatusReason[], but the API actually returns the standard list wrapper { type: "list", data: AwayStatusReason[] }. This made the generated SDKs cast the wrapper object to an array, so the typed return value never matched reality at runtime. Override the response schema in both the stable and preview override files to the list wrapper. Verified by preview-generating the TS SDK: listAwayStatusReasons now returns ListAwayStatusReasonsResponse ({ type, data }) and the regenerated wire test asserts the wrapper. Fixes intercom/intercom-node#520 --- fern/openapi-overrides.yml | 27 +++++++++++++++++++++++++++ fern/preview-openapi-overrides.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 0eac9dd..89adbee 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -29,6 +29,33 @@ paths: - admins x-fern-sdk-method-name: away x-fern-request-name: ConfigureAwayAdminRequest + # The spec types the 200 response as a bare `AwayStatusReason[]`, but the API + # actually returns the standard list wrapper `{ type: "list", data: [...] }`. + /away_status_reasons: + get: + responses: + "200": + content: + application/json: + schema: + "$ref": null + type: object + title: AwayStatusReasonList + description: A list of away status reasons. + items: null + properties: + type: + type: string + description: String representing the object's type. Always has the value `list`. + example: list + data: + type: array + description: An array of away status reason objects. + items: + "$ref": "#/components/schemas/away_status_reason" + required: + - type + - data /articles: get: x-fern-pagination: diff --git a/fern/preview-openapi-overrides.yml b/fern/preview-openapi-overrides.yml index 18002b6..b917327 100644 --- a/fern/preview-openapi-overrides.yml +++ b/fern/preview-openapi-overrides.yml @@ -22,6 +22,33 @@ paths: $ref: '#/components/schemas/CreateArticleRequestBody' '/articles/{id}': put: null + # The spec types the 200 response as a bare `AwayStatusReason[]`, but the API + # actually returns the standard list wrapper `{ type: "list", data: [...] }`. + '/away_status_reasons': + get: + responses: + "200": + content: + application/json: + schema: + "$ref": null + type: object + title: AwayStatusReasonList + description: A list of away status reasons. + items: null + properties: + type: + type: string + description: String representing the object's type. Always has the value `list`. + example: list + data: + type: array + description: An array of away status reason objects. + items: + "$ref": "#/components/schemas/away_status_reason" + required: + - type + - data '/articles/{article_id}/versions': get: x-fern-pagination: