-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
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.