@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technicity/openapi-sdk-generator",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -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,