Commit e22f3b0
fix(fetch): type narrowing with default response types (#443)
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.
---------
Co-authored-by: jeromeh <jerome.henaff@amdocs.com>1 parent cb04365 commit e22f3b0
23 files changed
Lines changed: 1621 additions & 613 deletions
File tree
- e2e
- src
- generated
- client
- axios
- fetch
- server
- express
- routes
- koa
- routes
- routes
- express
- koa
- integration-tests/typescript-fetch/src/generated
- azure-core-data-plane-service.tsp
- azure-resource-manager.tsp
- petstore-expanded.yaml
- stripe.yaml
- todo-lists.yaml
- packages/openapi-code-generator/src/typescript/client/typescript-fetch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
280 | 309 | | |
281 | 310 | | |
282 | 311 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments