-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package related
Description
Description
Hi, thanks again for the great work on this lib!
Using client-fetch, falsey values passed in as body (such as 0, "", false) will not get serialized and subsequently the body will be empty.
I've added a PR #2590 .
Edit: Looks like it'll be fixed in #2564 .
Reproducible example or configuration
Taken a test in client-fetch from the PR:
it('serializes an empty json string to a json-parseable body', async () => {
const mockResponse = new Response(null, {
status: 200,
});
const mockFetch: MockFetch = vi.fn().mockResolvedValue(mockResponse);
const result = await client.request({
body: '',
fetch: mockFetch,
method: 'PUT',
url: '/test',
});
expect(await result.request.text()).toBe('""');
});OpenAPI specification (optional)
No response
System information (optional)
No response
mrlubos and carson2222
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package related