Skip to content

Commit

Permalink
java: enums can have trailing commas so we can minimise the git diff …
Browse files Browse the repository at this point in the history
…when new enum members are added
  • Loading branch information
karlvr committed Oct 2, 2024
1 parent 1b74cc4 commit cb8a924
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silly-monkeys-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openapi-generator-plus/java-jaxrs-generator-common": minor
---

Java enums can have trailing commas so we can minimise the git diff when new enum members are added
5 changes: 4 additions & 1 deletion packages/java-jaxrs-common/templates/enumContents.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{>hooks/enumHeader}}
{{#each enumValues}}
@{{javax}}.xml.bind.annotation.XmlEnumValue({{{stringLiteral value}}}) {{{name}}}({{{literalValue}}}){{#unless @last}}, {{else}};{{/unless}}
@{{javax}}.xml.bind.annotation.XmlEnumValue({{{stringLiteral value}}}) {{{name}}}({{{literalValue}}}),
{{/each}}
{{#if enumValues}}
;
{{/if}}

private {{enumValueNativeType}} value;

Expand Down

0 comments on commit cb8a924

Please sign in to comment.