mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
Merge pull request #1076 from visortelle/patch-1
Fix undefined request body when body is a valid JSON falsy value: false or 0, "".
This commit is contained in:
commit
aa20f9e17b
@ -1,5 +1,5 @@
|
||||
const getRequestBody = (options: ApiRequestOptions): any => {
|
||||
if (options.body) {
|
||||
if (options.body !== undefined) {
|
||||
if (options.mediaType?.includes('/json')) {
|
||||
return JSON.stringify(options.body)
|
||||
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user