@technicity/openapi-sdk-generator 5.0.2 → 5.0.3

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.
@@ -182,7 +182,7 @@ async function getCode(input) {
182
182
  res = await interceptors.res(req, res);
183
183
  }
184
184
 
185
- const body = res.status === 204 ? null : await res.json();
185
+ const body = res.status === 204 ? null : !res.ok ? await res.clone().json() : await res.json();
186
186
 
187
187
  return { ok: res.ok as any, status: res.status as any, body, res };
188
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technicity/openapi-sdk-generator",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -229,7 +229,7 @@ async function getCode(input: {
229
229
  res = await interceptors.res(req, res);
230
230
  }
231
231
 
232
- const body = res.status === 204 ? null : await res.json();
232
+ const body = res.status === 204 ? null : !res.ok ? await res.clone().json() : await res.json();
233
233
 
234
234
  return { ok: res.ok as any, status: res.status as any, body, res };
235
235
  }