Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values for enums #2

Open
dvdeurse opened this issue Dec 2, 2019 · 0 comments
Open

Default values for enums #2

dvdeurse opened this issue Dec 2, 2019 · 0 comments

Comments

@dvdeurse
Copy link

dvdeurse commented Dec 2, 2019

The following spec shows the use of a default value for the enumProp field:

EnumExample:
  type: string
  enum:
    - One
    - Two

ObjectExample:
  type: object
  properties:
    enumProp:
      $ref: '#/components/schemas/EnumExample'
      default: 'One'

When generating the model classes, the 'default' value is not taken into account. It does work for simple datatypes though, but not for enumeration types that are referenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant