Description
When a response schema resolves through a chain of $refs, the generated handler
returns an empty string as the response body. No error is thrown and the status
code is still 200 — the body is just "". It happens with both msw/node and msw/browser servers.
Reproduction steps
Check out the following repository that reproduces the issue:
https://github.com/s-o-r-o-u-s-h/msw-source-issue
Expected behavior
It either needs to throw an error indicating that chaining multiple $refs is not supported or should resolve them recursively.
Initial assessment
I guess somewhere inside of src/open-api/utils/dereference.ts after line 21 should change to check if resolving a $ref will point to another $ref or not instead of hastily using pointerToPath(), but I'm not sure. I might be wrong.
Setup
- Node: v24.16.0
- @msw/source: 0.6.1
- msw: 2.14.6
- OS: Ubuntu 26.04 LTS
Description
When a response schema resolves through a chain of
$refs, the generated handlerreturns an empty string as the response body. No error is thrown and the status
code is still
200— the body is just"". It happens with bothmsw/nodeandmsw/browserservers.Reproduction steps
Check out the following repository that reproduces the issue:
https://github.com/s-o-r-o-u-s-h/msw-source-issue
Expected behavior
It either needs to throw an error indicating that chaining multiple $refs is not supported or should resolve them recursively.
Initial assessment
I guess somewhere inside of
src/open-api/utils/dereference.tsafter line 21 should change to check if resolving a $ref will point to another $ref or not instead of hastily using pointerToPath(), but I'm not sure. I might be wrong.Setup