feat: add support for translating @ to at_ in variable names for TypeScript clients

Merged
CE
2mo ago
+28-0

I'm having the same issue as https://github.com/OpenAPITools/openapi-generator/pull/12171. This PR applies the same principe, but for TypeScript clients


Summary by cubic

Translate leading @ in OpenAPI property names to at_ for TypeScript clients to avoid collisions and duplicate type fields (e.g., @type becomes atType/at_type). Implemented in AbstractTypeScriptClientCodegen, so it applies to all TS client generators.

  • Bug Fixes
    • Map leading @ to at_ in toVarName within AbstractTypeScriptClientCodegen.
    • Respect MODEL_PROPERTY_NAMING (e.g., camelCase vs original) when forming the final name.
    • Add tests for typescript-fetch and typescript-angular confirming @id => atId/at_id.