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

Nullable enums should contain the value null #668

Closed
2 of 4 tasks
fantapop opened this issue Apr 22, 2020 · 0 comments · Fixed by #670
Closed
2 of 4 tasks

Nullable enums should contain the value null #668

fantapop opened this issue Apr 22, 2020 · 0 comments · Fixed by #670

Comments

@fantapop
Copy link
Contributor

Currently the string "null" is added to nullable enums instead of the value. This results in code generation where the value is the string value null. This is described in more detail In the section on Nullable Enums here.

Sorting

  • I'm submitting a ...

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn't already been submit

Expected Behavior

MyNullableString:
  oneOf:
  - type: string
  - type: number
    enum:
    - null
    nullable: true

Current Behavior

MyNullableString:
  oneOf:
  - type: string
  - type: number
    enum:
    - 'null'
    nullable: true

Steps to Reproduce

  1. Add a nullable type in an type used in a controller
  2. build the swagger spec

Context (Environment)

Version of the library: 3.0.4
Version of NodeJS: 12.12

  • Confirm you were using yarn not npm: [x]

Detailed Description

use the value null in nullable enums instead of the string "null"

Breaking change?

Breaking yes but V3 hasn't stabilized yet.

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

Successfully merging a pull request may close this issue.

1 participant