[typescript-fetch][Fix] oneOf models are generated without ...ToJSONTyped functions but models referencing still try to import (#20046)

* Fix #19858

* re-generate the samples
This commit is contained in:
Jules Ivanic 2024-11-08 00:33:33 +11:00 committed by GitHub
parent 28e02fc1a2
commit 2c38d0de35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
163 changed files with 654 additions and 646 deletions

View File

@ -41,7 +41,11 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole
{{/discriminator}} {{/discriminator}}
} }
export function {{classname}}ToJSON(value?: {{classname}} | null): any { export function {{classname}}ToJSON(json: any): any {
return {{classname}}ToJSONTyped(json, false);
}
export function {{classname}}ToJSONTyped(value?: {{classname}} | null, ignoreDiscriminator: boolean = false): any {
if (value == null) { if (value == null) {
return value; return value;
} }

View File

@ -52,7 +52,11 @@ export function TestResponseFromJSONTyped(json: any, ignoreDiscriminator: boolea
return {} as any; return {} as any;
} }
export function TestResponseToJSON(value?: TestResponse | null): any { export function TestResponseToJSON(json: any): any {
return TestResponseToJSONTyped(json, false);
}
export function TestResponseToJSONTyped(value?: TestResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) { if (value == null) {
return value; return value;
} }