Skip to content

fix(fetch): type narrowing with default response types#443

Merged
mnahkies merged 4 commits intomainfrom
mn/439/fetch-default-response-narrowing
May 2, 2026
Merged

fix(fetch): type narrowing with default response types#443
mnahkies merged 4 commits intomainfrom
mn/439/fetch-default-response-narrowing

Conversation

@mnahkies
Copy link
Copy Markdown
Owner

@mnahkies mnahkies commented Mar 18, 2026

relates #439, and includes changes from #444 as the actual fix

  • adds failing test showing that type narrowing isn't working as expected for fetch clients when a default response is present
  • adjusts the types to exclude specific status codes from the default response branch. The specification states that the default response is only to be used for responses not otherwise declared:

The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.

@mnahkies mnahkies force-pushed the mn/439/fetch-default-response-narrowing branch from 13f6354 to dd872f1 Compare May 2, 2026 18:51
@mnahkies mnahkies force-pushed the mn/439/fetch-default-response-narrowing branch from dd872f1 to f9f86cf Compare May 2, 2026 18:54
@mnahkies mnahkies marked this pull request as ready for review May 2, 2026 18:56
@mnahkies mnahkies merged commit e22f3b0 into main May 2, 2026
22 checks passed
@mnahkies mnahkies deleted the mn/439/fetch-default-response-narrowing branch May 2, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant