File tree Expand file tree Collapse file tree
src/common/apis/icanhazdadjoke Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ export default defineConfig(
7777 // Use PascalCase for schema names
7878 case : "PascalCase" ,
7979
80+ dates : {
81+ // Allow datetimes without timezone
82+ local : true ,
83+
84+ // Allow datetimes with offset timezone
85+ offset : true ,
86+ } ,
87+
8088 definitions : {
8189 name : "{{name}}Schema" ,
8290 } ,
Original file line number Diff line number Diff line change @@ -182,10 +182,16 @@ export const createClient = (config: Config = {}): Client => {
182182 case "arrayBuffer" :
183183 case "blob" :
184184 case "formData" :
185- case "json" :
186185 case "text" :
187186 data = await response [ parseAs ] ( ) ;
188187 break ;
188+ case "json" : {
189+ // Some servers return 200 with no Content-Length and empty body.
190+ // response.json() would throw; read as text and parse if non-empty.
191+ const text = await response . text ( ) ;
192+ data = text ? JSON . parse ( text ) : { } ;
193+ break ;
194+ }
189195 case "stream" :
190196 return opts . responseStyle === "data"
191197 ? response . body
@@ -267,6 +273,10 @@ export const createClient = (config: Config = {}): Client => {
267273 }
268274 return request ;
269275 } ,
276+ serializedBody : getValidRequestBody ( opts ) as
277+ | BodyInit
278+ | null
279+ | undefined ,
270280 url,
271281 } ) ;
272282 } ;
Original file line number Diff line number Diff line change 11// This file is auto-generated by @hey-api/openapi-ts
22
3- import { z } from "zod" ;
3+ import * as z from "zod" ;
44
55/**
66 * Success response payload for getting a random joke
You can’t perform that action at this time.
0 commit comments