Skip to content

Open Api 3.0.3: nullable attribute #8

@drozenberg

Description

@drozenberg

I'm using Open API v3.0.3 and I have a column that can be either a string or null. For example:

activated_at:
  type: string
  nullable: true
  format: date-time

When I do a fragment validation, however, I get the following error:

JSON::Schema::ValidationError: The property '#/activated_at' of type null did not match the following type: string

When I format my api doc according to the OpenApi v3.1 spec, it works. However, I can't use v3.1 for this particular project. The OpenApi v3.1 format is shown below:

activated_at:
  type:
     - string
     - 'null'

Is Open API v3.0.3 supported? Or is it validation done against 3.1 by default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions