Skip to content

fix(typescript-axios): add trailing commas to as const enums#23275

Merged
wing328 merged 1 commit intoOpenAPITools:masterfrom
scarf005:fix/ts-axios-as-const-trailing-commas
Mar 17, 2026
Merged

fix(typescript-axios): add trailing commas to as const enums#23275
wing328 merged 1 commit intoOpenAPITools:masterfrom
scarf005:fix/ts-axios-as-const-trailing-commas

Conversation

@scarf005
Copy link
Copy Markdown
Contributor

@scarf005 scarf005 commented Mar 17, 2026

PR checklist

  • tests updated
  • samples updated
  • target: master

Keep as const enum object diffs smaller when values are appended.

  • ./mvnw -pl modules/openapi-generator -am -Dtest=TypeScriptAxiosClientCodegenTest -Dsurefire.failIfNoSpecifiedTests=false test
  • ./bin/generate-samples.sh ./bin/configs/typescript-axios*.yaml

Summary by cubic

Add trailing commas to generated as const enum objects in typescript-axios to keep diffs small when new values are appended. This updates the templates and locks the behavior with a test.

  • Bug Fixes
    • Emit trailing commas in as const enums by updating apiInner.mustache, modelGeneric.mustache, and modelObjectEnum.mustache.
    • Added a test to verify output; regenerated typescript-axios samples.

Written for commit 05d9449. Summary will update on new commits.

Keep enum object diffs smaller when values are appended.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 19 files

@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 17, 2026

thanks for the PR

cc @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) @dennisameling (2026/02)

@wing328 wing328 merged commit 6332eab into OpenAPITools:master Mar 17, 2026
36 of 37 checks passed
@wing328 wing328 added this to the 7.21.0 milestone Mar 17, 2026
scarf005 added a commit to scarf005/openapi-generator that referenced this pull request Mar 17, 2026
…23275)

Keep enum object diffs smaller across Angular, Fetch, and NestJS server generators.
scarf005 added a commit to scarf005/openapi-generator that referenced this pull request Mar 24, 2026
…23275)

Keep enum object diffs smaller across Angular, Fetch, and NestJS server generators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants