You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parameters:
- name: approvedin: bodyrequired: truedescription: Whether to approve or disapprove the entity.schema:
type: boolean
If approved is set as true, then the call works perfectly. Otherwise, it fails, since the code (in ApiClient.js in the function callApi) contains the following:
} else if (bodyParam) {
request.send(bodyParam);
}
Description
When a body parameter is of type
boolean
and isfalse
, then parameter does not get sent to the server.Version
openapi-generator-cli-3.3.3-20181113.090410-41.jar
Swagger declaration file content or url
Example parameter:
If
approved
is set astrue
, then the call works perfectly. Otherwise, it fails, since the code (inApiClient.js
in the functioncallApi
) contains the following:Of course,
bodyParam
isfalse
, so it is not sent.Command line used for generation
Steps to reproduce
Use this Swagger definition:
and see the generated call. Try to use it with both
approved
astrue
and asfalse
.Related issues
This is a similar issue in swagger-codegen, with more information:
swagger-api/swagger-codegen#5847
Suggest a Fix
If there is a body parameter defined in the swagger definition, always send it. Except, perhaps, if it is
undefined
.The text was updated successfully, but these errors were encountered: