Skip to content
Discussion options

You must be logged in to vote

Hi, @alveshelio. Thanks for raising this.

If you take a look at the generics to rest.* methods, you will see that they are listing things in the following order:

  • Request body
  • Request parameters
  • Response body

msw/src/rest.ts

Lines 13 to 17 in 7380011

return <
RequestBodyType extends DefaultBodyType = DefaultBodyType,
Params extends PathParams<keyof Params> = PathParams,
ResponseBody extends DefaultBodyType = DefaultBodyType,
>(

If you wish to annotate your handlers, respect that order:

rest.get<DefaultBodyType, never, Journey>(url, resolver)

Note that you don't need to wrap anything in ResponseResolver type, it's already done under the hood.

Let me…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alveshelio
Comment options

Answer selected by alveshelio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants