Skip to content

support integer enum  #701

@esoni88

Description

@esoni88
Description

Hi All,
is possible generate integer enum with alias value ?
For i.e

    type: integer
    enum:
      - Outright
      - Switch
      - Butterfly

The gen raise the errore
Exception in thread "main" java.lang.IllegalArgumentException: Cannot deserialize value of type java.lang.Number from String "Outright": not a valid number

The expected result ( for i.e using java) is the following:

public enum RfqLegTypeEnum {
  
  Outright(0),
  
  Switch(1),
  
  Butterfly(2),

How can obtain this result ?

openapi-generator version

3.1.2

OpenAPI declaration file content or url

Thnx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions