Content type with `charset` not supported
govizlora opened this issue · comments
Hi, thank you for making the tool!
In my first try to convert my OpenAPI spec, it fails to parse the below content
"requestBody": {
"content": {
"application/json;charset=UTF-8": {
"schema": {
"$ref": "#/components/schemas/Foo"
}
}
},
}
After comparing with your input example, I replaced application/json;charset=UTF-8
to application/json
, and now it works perfectly.
Would be nice if it can support the content with charset
specified, or at least throw an error to prompt the user to remove the charset
part.
hey, that's what the isMediaTypeAllowed
option is for
openapi-zod-client/lib/src/getZodiosEndpointDefinitionList.ts
Lines 53 to 58 in 3cde964
also available as a CLI arg
--media-type-expr Pass an expression to determine which response content should be allowed