Reading issue
← Back to microsoft/playwright
microsoft / playwright · Issue No. 42154
It would be great to be able to directly type the response type of the provided APIResponse.json() instead of having an any type.
Already discussed in:
https://github.com/microsoft/playwright/issues/13795
interface User {
id: string;
name: string;
}
const response = await request.get<User>('/api/users/42');
// Directly typed as User 🥳
const user = await response.json()
It would allow better type safety for requests made with Playwright, instead of using type cast.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.