Skip to content

Commit c56d57a

Browse files
committed
Set default value for format parameter
1 parent 5962542 commit c56d57a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates-v7/typescript/model/ObjectSerializer.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ export class ObjectSerializer {
159159
*
160160
* @param data - The value to serialize.
161161
* @param type - The expected type name as a string.
162-
* @param format - Format hint (e.g. "date" or "date-time").
162+
* @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string.
163163
* @returns A JSON-compatible representation of `data`.
164164
*/
165-
public static serialize(data: any, type: string, format: string): any {
165+
public static serialize(data: any, type: string, format: string = ""): any {
166166
if (data == undefined) {
167167
return data;
168168
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
@@ -239,10 +239,10 @@ export class ObjectSerializer {
239239
*
240240
* @param data - The raw input to deserialize.
241241
* @param type - The expected type name as a string.
242-
* @param format - Format hint (e.g. "date" or "date-time").
242+
* @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string.
243243
* @returns A deserialized instance or value of `data`.
244244
*/
245-
public static deserialize(data: any, type: string, format: string): any {
245+
public static deserialize(data: any, type: string, format: string = ""): any {
246246
// polymorphism may change the actual type.
247247
type = ObjectSerializer.findCorrectType(data, type);
248248
if (data == undefined) {

0 commit comments

Comments
 (0)