mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 10:35:25 +00:00
Send "true" or "false" for boolean params. (#2257)
* Send "true" or "false" for boolean params. * run ./bin/openapi3/php-petstore.sh
This commit is contained in:
parent
39553af06e
commit
b5ede4b339
@ -165,8 +165,9 @@ class ObjectSerializer
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the parameter. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
* If it's a boolean, convert it to "true" or "false".
|
||||
*
|
||||
* @param string|\DateTime $value the value of the parameter
|
||||
* @param string|bool|\DateTime $value the value of the parameter
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
@ -174,6 +175,8 @@ class ObjectSerializer
|
||||
{
|
||||
if ($value instanceof \DateTime) { // datetime in ISO8601 format
|
||||
return $value->format(\DateTime::ATOM);
|
||||
} else if (is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
|
@ -175,8 +175,9 @@ class ObjectSerializer
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the parameter. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
* If it's a boolean, convert it to "true" or "false".
|
||||
*
|
||||
* @param string|\DateTime $value the value of the parameter
|
||||
* @param string|bool|\DateTime $value the value of the parameter
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
@ -184,6 +185,8 @@ class ObjectSerializer
|
||||
{
|
||||
if ($value instanceof \DateTime) { // datetime in ISO8601 format
|
||||
return $value->format(\DateTime::ATOM);
|
||||
} else if (is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
|
@ -175,8 +175,9 @@ class ObjectSerializer
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the parameter. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
* If it's a boolean, convert it to "true" or "false".
|
||||
*
|
||||
* @param string|\DateTime $value the value of the parameter
|
||||
* @param string|bool|\DateTime $value the value of the parameter
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
@ -184,6 +185,8 @@ class ObjectSerializer
|
||||
{
|
||||
if ($value instanceof \DateTime) { // datetime in ISO8601 format
|
||||
return $value->format(\DateTime::ATOM);
|
||||
} else if (is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user