Parameter object defines neither a schema nor a content property
Issue ID: v3-validation-parameter-schema-content-not-present
Description
You have defined neither the schema
nor content
property for one or more parameter
objects in your API. All parameters must have either schema
or content
property defined.
For more details, see the OpenAPI Specification.
Example
The following is an example of how this issue could look in your API definition:
{
"/pets/{id}": {
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "find pet by id",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to fetch",
"required": true
}
]
}
}
}
Remediation
Make sure that you have defined either the schema
or content
property for all parameter
objects in your API.
{
"/pets/{id}": {
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "find pet by id",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to fetch",
"required": true,
"schema": {
"type": "integer",
"additionalProperties": false,
"format": "int64"
}
}
]
}
}
}