Skip to content

Commit

Permalink
Improve typescript-fetch code generation for oneOf cases without di…
Browse files Browse the repository at this point in the history
…scriminator (#18702)
  • Loading branch information
odiak committed May 18, 2024
1 parent 62238c6 commit 57dceae
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole
}
{{/discriminator}}
{{^discriminator}}
return {{#oneOf}}{{{.}}}FromJSONTyped(json, true){{^-last}} || {{/-last}}{{/oneOf}};
{{#oneOf}}
if (instanceOf{{{.}}}(json)) {
return {{{.}}}FromJSONTyped(json, true);
}
{{/oneOf}}
{{/discriminator}}
}

Expand Down

0 comments on commit 57dceae

Please sign in to comment.