fix: type listAwayStatusReasons response as list wrapper#558
Open
fern-support wants to merge 1 commit into
Open
fix: type listAwayStatusReasons response as list wrapper#558fern-support wants to merge 1 commit into
fern-support wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
GET /away_status_reasons(listAwayStatusReasons) had its200response modeled as a bare array,AwayStatusReason[]. The endpoint actually returns Intercom's standard list wrapper:{ "type": "list", "data": [ /* AwayStatusReason objects */ ] }Because Fern generates from the spec, every SDK cast the wrapper object straight to
AwayStatusReason[], so the typed return value never matched the runtime value (e.g.response[0]/response.map(...)silently break).This PR overrides the response schema to the list wrapper in both Fern override files (the
descriptions/specs are a generated artifact, so the fix belongs in the override layer):fern/openapi-overrides.yml— stable spec (drives the2.14SDK source)fern/preview-openapi-overrides.yml— preview namespace (drives the0source)Which API versions are affected
The endpoint exists in
2.14,2.15, and0(preview). The override layer applies to the two specs that drive SDK generation: stable (2.14) and preview (0).Verification
Preview-generated the TypeScript SDK locally with the override:
The regenerated wire test now mocks and asserts
{ type: "list", data: [...] }.fern checkreports no new errors versusmain.Note
This is technically a breaking change to the generated return type, though the SDK was already incorrect at runtime. Worth sequencing the SDK releases as a major bump.
Fixes intercom/intercom-node#520
Linear: FER-11398