According to the OpenAPI Spec, request parameters should be treated optional by default.
The client-generator for typescript treats them as mandatory by default, thus converting unspecified parameters to string undefined which may break the API:
|
requestContext.setHeaderParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}")); |
My suggestion is:
- check if the parameter is
required and if not:
- check if the value is undefined or not before calling
setHeaderParam.
According to the OpenAPI Spec, request parameters should be treated optional by default.
The client-generator for
typescripttreats them as mandatory by default, thus converting unspecified parameters to stringundefinedwhich may break the API:openapi-generator/modules/openapi-generator/src/main/resources/typescript/api/api.mustache
Line 75 in 1bfe800
My suggestion is:
requiredand if not:setHeaderParam.