Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function {{classname}}ToJSONTyped(value?: {{#hasReadOnly}}Omit<{{classnam
return {{modelName}}ToJSONTyped(value as {{modelName}}, ignoreDiscriminator);
{{/discriminator.mappedModels}}
default:
throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${value['{{discriminator.propertyName}}']}'`);
return value;
}
}
{{/discriminator}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole
return Object.assign({}, {{modelName}}FromJSONTyped(json, true), { {{discriminator.propertyName}}: '{{mappingName}}' } as const);
{{/discriminator.mappedModels}}
default:
throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${json['{{discriminator.propertyName}}']}'`);
return json;
}
{{/discriminator}}
{{^discriminator}}
Expand Down Expand Up @@ -56,7 +56,7 @@ export function {{classname}}ToJSONTyped(value?: {{classname}} | null, ignoreDis
return Object.assign({}, {{modelName}}ToJSON(value), { {{discriminator.propertyName}}: '{{mappingName}}' } as const);
{{/discriminator.mappedModels}}
default:
throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${value['{{discriminator.propertyName}}']}'`);
return json;
}
{{/discriminator}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function AbstractUserDtoToJSONTyped(value?: AbstractUserDto | null, ignor
case 'remote-authenticated':
return RemoteAuthenticatedUserDtoToJSONTyped(value as RemoteAuthenticatedUserDto, ignoreDiscriminator);
default:
throw new Error(`No variant of AbstractUserDto exists with 'type=${value['type']}'`);
return value;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function AnimalToJSONTyped(value?: Animal | null, ignoreDiscriminator: bo
case 'DOG':
return DogToJSONTyped(value as Dog, ignoreDiscriminator);
default:
throw new Error(`No variant of Animal exists with 'className=${value['className']}'`);
return value;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the expected return type is : any, this is fine.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function ParentWithNullableToJSONTyped(value?: ParentWithNullable | null,
case 'ChildWithNullable':
return ChildWithNullableToJSONTyped(value as ChildWithNullable, ignoreDiscriminator);
default:
throw new Error(`No variant of ParentWithNullable exists with 'type=${value['type']}'`);
return value;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the expected return type is : any, this is fine.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function AnimalToJSONTyped(value?: Animal | null, ignoreDiscriminator: bo
case 'DOG':
return DogToJSONTyped(value as Dog, ignoreDiscriminator);
default:
throw new Error(`No variant of Animal exists with 'className=${value['className']}'`);
return value;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the expected return type is : any, this is fine.

}
}

Expand Down
Loading