[BUG] [typescript-fetch] oneOf models are generated without ...ToJSONTyped
functions but models referencing still try to import
#19858
Labels
...ToJSONTyped
functions but models referencing still try to import
#19858
Bug Report Checklist
Description
When an object includes a field that is a oneOf type, the generation of the oneOf does not include
...ToTypedJson
method but the parent object attempts to import it still.openapi-generator version
7.9.0
OpenAPI declaration file content or url
Small yaml that can produce
https://gist.github.com/joshasharpe/33ae2391c163f3db78f56e57ccf6d8dd
Generation Details
typescript-fetch with docker main
Steps to reproduce
typescript-fetch
generator to create typescript code.Related issues/PRs
Simliar to:
Suggest a fix
Adding to this file,
https://github.com/hagis/openapi-generator/blob/c36df78cff1142615f478b06d1274ccf565586cd/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache#L105
I am not sure if it is 1:1 or whether there are other functions missing. I did not see documentation explaining that this was intentional. If so, we would have to make the import conditional on whether the "child" model is oneOf.
The text was updated successfully, but these errors were encountered: