Skip to content

Commit

Permalink
Merge pull request #6 from 77web/feat/accept-enum-as-path-parameter
Browse files Browse the repository at this point in the history
convert enum instance to value in toString()
  • Loading branch information
77web authored Oct 11, 2022
2 parents 02a7bdf + ec8fd4b commit f684b6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ class ObjectSerializer
return $value->format(self::$dateTimeFormat);
} elseif (is_bool($value)) {
return $value ? 'true' : 'false';
} elseif ($value instanceof \BackedEnum) {
return $value->value;
} else {
return (string) $value;
}
Expand Down

0 comments on commit f684b6b

Please sign in to comment.