@technicity/openapi-sdk-generator 5.9.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generate-remix.js +2 -2
- package/package.json +1 -1
- package/src/generate-remix.ts +2 -2
package/dist/generate-remix.js
CHANGED
|
@@ -290,7 +290,7 @@ function getCode({ results, baseUrl, generateOrThrow, env, excludeFetchImport, }
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
const body =
|
|
293
|
-
res.status === 204
|
|
293
|
+
res.status === 204 || (response.headers.get("content-type") && !response.headers.get("content-type").startsWith("application/json"))
|
|
294
294
|
? null
|
|
295
295
|
: !res.ok
|
|
296
296
|
? await res.clone().json()
|
|
@@ -416,7 +416,7 @@ function getCode({ results, baseUrl, generateOrThrow, env, excludeFetchImport, }
|
|
|
416
416
|
throw toThrow;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
const body = res.status === 204 ? null : await res.json();
|
|
419
|
+
const body = res.status === 204 || (response.headers.get("content-type") && !response.headers.get("content-type").startsWith("application/json")) ? null : await res.json();
|
|
420
420
|
|
|
421
421
|
return {
|
|
422
422
|
ok: res.ok as any,
|
package/package.json
CHANGED
package/src/generate-remix.ts
CHANGED
|
@@ -331,7 +331,7 @@ function getCode({
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
const body =
|
|
334
|
-
res.status === 204
|
|
334
|
+
res.status === 204 || (response.headers.get("content-type") && !response.headers.get("content-type").startsWith("application/json"))
|
|
335
335
|
? null
|
|
336
336
|
: !res.ok
|
|
337
337
|
? await res.clone().json()
|
|
@@ -460,7 +460,7 @@ function getCode({
|
|
|
460
460
|
throw toThrow;
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
-
const body = res.status === 204 ? null : await res.json();
|
|
463
|
+
const body = res.status === 204 || (response.headers.get("content-type") && !response.headers.get("content-type").startsWith("application/json")) ? null : await res.json();
|
|
464
464
|
|
|
465
465
|
return {
|
|
466
466
|
ok: res.ok as any,
|