-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fix typescript-fetch broken files when mixing basic types and refs in oneOf #21057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…g and array support
…n TypeScript code generators
thanks for your contribution! |
Hi folks! Our build with 7.13.0 starts to fail, I suspect that because of changes from this pull request. Basically, imports are absent for some reason in model files, e.g. /* tslint:disable */
/* eslint-disable */
/**
* ...
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type Access
*
* @export
*/
export type Access = { accessType: 'manual' } & SoftwareAccess ... Note that it has no import even so it uses A few uncommon things that I was able to find about our API ref is that we're prefixing our OneOf with "access": {
"oneOf": [
{
"$ref": "#/components/schemas/_SoftwareAccess"
},
{
"$ref": "#/components/schemas/_AnotherModel"
}
],
"title": "Access",
... And that we're using discriminators for these oneofs |
@GregoryMerlet @b0g3r do you want to fix this? |
I can try to fix it if there's a way to reproduce it. @b0g3r would you be able to create an openapi file with the minimal informations to reproduce your problem please ? |
Was able to craft a reproducible example: https://gist.github.com/b0g3r/4610d89d3a06e99792a9f6f7747d5504, the issue with a oneof field with discriminator Another one was spotted as well, in "ToJSONTyped" function |
We stubled upon the same issue. Is there any news on fixing this in the future or do we need to use the older generator? |
We just updated from 7.7 to 7.13 and we have the same problem. If I revert this commit, the imports are fixed but there is still a bug in I think it's caused by #20983 The |
… refs in oneOf (OpenAPITools#21057)" This reverts commit a94b8f9.
@b0g3r should you create a new issue about the problem? It seems that nobody is going to address the problem in this Merged pull request. 🤔 |
Closes #19909
Based on #20193 and improved to support any basic type, not just strings.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)TypeScript committee members: @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) @joscha (2024/10)