Path parameter must have the property 'required' set to 'true'
Issue ID: v3-validation-parameter-path-required
Description
The required
property of the path parameter in question is either missing altogether, or it is set to false
. All path parameters must have the property required
set to true
.
For more details, see the OpenAPI Specification.
Example
The following is an example of how this issue could look in your API definition. Here, the property required
is set to false
:
{
"name": "ID",
"in": "path",
"description": "ID to fetch",
"required": false,
"type": "integer"
// ...
}
While here, the property has been forgotten altogether:
{
"name": "ID",
"in": "path",
"description": "ID to fetch",
"type": "integer"
// ...
}
Remediation
Make sure that all path parameters have the required
property set to true
.
{
"name": "ID",
"in": "path",
"description": "ID to fetch",
"required": true,
"type": "integer"
// ...
}