Skip to content

Enum values with backslash (escape character) produce invalid client code #2180

@dmateusp

Description

@dmateusp

Hi I'm trying to generate a client for an OpenAPI spec with the following enum:

  "auto_accident_significant_injury": {
    "enum": ["YES", "NO", "N\\A"],
    "type": "string",
    "description": "",
    "title": "Auto accident significant injury"
  },

It's generating the following invalid Go code:

  PatientAutoAccidentInsuranceAutoAccidentSignificantInjuryNA PatientAutoAccidentInsuranceAutoAccidentSignificantInjury = "N\A"

I believe the correct code would be

  PatientAutoAccidentInsuranceAutoAccidentSignificantInjuryNA PatientAutoAccidentInsuranceAutoAccidentSignificantInjury = "N\\A"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions