Skip to content

nullable is problematic for query and path parameters #1915

@mkistler

Description

@mkistler

I believe the nullable: true designation in the schema of a query or path parameter is problematic, or at the very least under-specified. According to the OpenAPI 3.0.2 spec, nullable: true means:

Allows sending a null value for the defined schema.

If param is a query parameter of type string that is defined as nullable: true, does ?param=null mean param is the null value or that param has the string value "null"? Or perhaps it means that users can specify ?param= with no value?

Likewise, if pet_id is a path parameter of type string that is defined as nullable: true, how would a user construct a path that specifies pet_id = null? I don't think it could be /api/pets/null. Likewise, I don't think it could be /api/pets/.

I believe the spec should be clarified to describe what it means to "send null" for a query or path parameter, or simply disallow nullable: true for these schemas.

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