hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.31k stars 102 forks source link

If a keyword generated type has underscore prefix, underscore is excluded on nested array reference #1257

Open nutrian opened 6 hours ago

nutrian commented 6 hours ago

Description

It might have to do with reserved keywords, but the generated schema type itself will be _case

But a response data referring to it won't include the prefix _ resulting in a TS error

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-keyword-issue?file=src%2Fclient%2Ftypes.gen.ts

OpenAPI specification (optional)

No response

System information (optional)

No response

mrlubos commented 6 hours ago

@nutrian can you please add a reproducible example?

stackblitz[bot] commented 6 hours ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

nutrian commented 6 hours ago

@nutrian can you please add a reproducible example?

@mrlubos added

mrlubos commented 5 hours ago

I see. Try to re-run it with experimental parser if the issue persists? https://heyapi.dev/openapi-ts/configuration.html#parser

If yes, I'll fix it tomorrow. If not, please use the new parser if possible

mrlubos commented 5 hours ago

If you do end up using the experimental parser, let me know if your other issue is fixed too!

nutrian commented 5 hours ago

@mrlubos experimental parser did not fix this issue