Skip to content

Question: nullable and enum #1900

Closed
Closed
@left-rite

Description

@left-rite

Hey,

I am hoping to get clarification on the following:

When the nullable and enum keywords are used together, which takes precedence?

i.e.

type: string
nullable: true
enum:
  - one
  - two
propertyA = null

When propertyA is validated against the definition. Should the result be:

  1. true, since the it's nullable
  2. false, because null is not part of the enum
  3. something else?

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