Skip to content

Commit a7dc2e0

Browse files
committed
Use "true" and "false" for multipart/form-data booleans
Do not use "1" and "0" implicitly Fixes #9903
1 parent dd88ba7 commit a7dc2e0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public:
3636
void setConfiguration(std::shared_ptr<ApiConfiguration> configuration);
3737
3838
static utility::string_t parameterToString(utility::string_t value);
39+
static utility::string_t parameterToString(bool value);
3940
static utility::string_t parameterToString(int32_t value);
4041
static utility::string_t parameterToString(int64_t value);
4142
static utility::string_t parameterToString(float value);

modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
3131
{
3232
return value;
3333
}
34+
35+
utility::string_t ApiClient::parameterToString(bool value)
36+
{
37+
std::stringstream valueAsStringStream;
38+
valueAsStringStream << (value ? "true" : "false");
39+
return utility::conversions::to_string_t(valueAsStringStream.str());
40+
}
41+
3442
utility::string_t ApiClient::parameterToString(int64_t value)
3543
{
3644
std::stringstream valueAsStringStream;

0 commit comments

Comments
 (0)