Skip to content

[BUG] Enum name generation throws error when including parenthesis ")" #827

@Verilyzed

Description

@Verilyzed

Describe the bug
When using brackets (parenthesis) in an enum name this error occurs.

What gets generated:

@JsonValue('Lieferbeginn (Einzug)')
lieferbeginnEinzug)('Lieferbeginn (Einzug)'),
@JsonValue('Lieferende (Auszug)')
lieferendeAuszug)('Lieferende (Auszug)'),

To Reproduce
Create an enum like this:

"ZaehlerstandAblesegrund":
  {
    "type": "string",
    "enum":
      [
        "Schätzung",
        "Zwischenablesung",
        "Zählereinbau",
        "Lieferbeginn (Einzug)",
        "Lieferende (Auszug)",
        "Unbekannt",
      ],
  },

Expected behavior
I would expect a normal generated enum. What should get generated:

@JsonValue('Lieferbeginn (Einzug)')
lieferbeginnEinzug('Lieferbeginn (Einzug)'),
@JsonValue('Lieferende (Auszug)')
lieferendeAuszug('Lieferende (Auszug)'),

Swagger specification link
Mentioned example above, complete specification is redacted for company privacy reasons. But I can provide more details if needed.

Library version used:
4.0.2

Additional context
Add any other context about the problem here.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions