Skip to content

OpenAPI 3.1 support has a bug w/ nullable types #950

@jasikpark

Description

@jasikpark

Describe the bug

As mentioned in #410 (comment), when using this plugin with an OpenAPI 3.1 schema that uses [string, null] as a list of valid types for a property, instead of showing the enum of types, it joins the array together with no spaces.

Expected behavior

Show a "nullable" tag for the property or just list the valid property types.

For example of the usage, see https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 and "Swap nullable for type arrays"

Another example of this valid usage in OpenAPI 3.1: OAI/OpenAPI-Specification#3148

Current behavior

The list of valid property types are joined into a string with no spaces.

Possible solution

Steps to reproduce

  1. Create an OpenAPI 3.1 schema that has a property with type [string, null]
  2. Render API docs with the plugin

Screenshots

Context

Trying to keep up-to-date with the current OpenAPI schema while providing clear, useful, and accurate api docs to our users.

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions