Open babariviere opened 3 weeks ago
did you try setting the modelPropertyNaming
option to original
?
ref: https://openapi-generator.tech/docs/generators/typescript-fetch/
@wing328 just tested it and the result is the same.
what about using the nameMapping option?
https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#name-mapping
Well yes it works... but shouldn't the default behavior to preserve the original property naming? This feels like a bug, I except my models to be the same as in my openapi when using minimal settings.
Bug Report Checklist
Description
When using a reserved word with
typescript-fetch
generator, the field will be prefixed with_
but it would not conflict with any types generated by openapi-generator.openapi-generator version
7.9.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
If you reproduce the generation steps with the given schema, you will have in
out/models/index.ts
this interface:I have provided a reproduction repo if needed: https://github.com/babariviere/openapi-generator-repro
Related issues/PRs
7474
Suggest a fix
Request / response fields should be ignored for reserved word. Mapping should be 1:1.