responses:
302:
description: Redirect Response
headers:
Location:
required: true
schema:
type: string
generates
headers: {
location: response.headers.get('Location') ?? undefined,
setCookie: response.headers.get('Set-Cookie') ?? undefined,
},
Which will error as the generated response interface is:
status: 302
body?: undefined
headers: {
'location': string
'setCookie': string
}
Should this always be optional on the client side regardless of the required param?
status: 302
body?: undefined
headers: {
'location'?: string
'setCookie'?: string
}
In which case we can do
packages/typescript-fetch-client2/templates/frag/apiResponseTypes.hbs
line 61: {{{stringLiteral name}}}?: {{{nativeType}}} (optional)
That may be better than stating that the headers.get will always be defined
generates
Which will error as the generated response interface is:
Should this always be optional on the client side regardless of the required param?
In which case we can do
packages/typescript-fetch-client2/templates/frag/apiResponseTypes.hbs
line 61: {{{stringLiteral name}}}?: {{{nativeType}}}(optional)That may be better than stating that the headers.get will always be defined