openapi: "3.0.3"
info:
  title: "Nullable field schema for a nullability table"
  version: "1.0.0"
  description: "The nullability table on this page enumerates the four combinations that the schema can express. A required field with a nullable type produces a column that still cannot be null. An optional field with a non-nullable type produces a nullable column, which is where the two tools differ. The phone column is the optional-and-nullable case and is the one that is easiest to get wrong."
paths: {}
x-domain-id: "spec_nullable"
x-dialect: "postgres"
components:
  schemas:
    accounts:
      type: "object"
      x-primary-key: "id"
      required: ["id", "email", "display_name", "locale"]
      properties:
        id:
          type: "string"
          format: "uuid"
        email:
          type: "string"
          format: "email"
          x-unique: true
        display_name:
          type: "string"
        nickname:
          type: "string"
          nullable: true
        phone:
          type: "string"
          nullable: true
        locale:
          type: "string"
          minLength: 2
          maxLength: 5
