openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[BUG] [typescript-fetch] JSON.stringify on `text/plain` requestBody

Open tobq opened this issue 3 years ago • 0 comments

        const init: RequestInit = {
            ...overridedInit,
            body:
                isFormData(overridedInit.body) ||
                overridedInit.body instanceof URLSearchParams ||
                isBlob(overridedInit.body)
                    ? overridedInit.body
                    : JSON.stringify(overridedInit.body),
        };

Here, you can see the request body is stringified, resulting in "body-text" rather than the expected body-text

Generator Version: 6.1.0 (latest) Generator: typescript-fetch

tobq avatar Sep 17 '22 21:09 tobq