hey-api / openapi-ts

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

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

Closed nutrian closed 1 week ago

nutrian commented 1 week 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 1 week ago

@nutrian can you please add a reproducible example?

stackblitz[bot] commented 1 week ago

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

nutrian commented 1 week ago

@nutrian can you please add a reproducible example?

@mrlubos added

mrlubos commented 1 week 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 1 week ago

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

nutrian commented 1 week ago

@mrlubos experimental parser did not fix this issue

mrlubos commented 1 week ago

@nutrian upgrade to the latest version, it's already been fixed