Schema object property has both 'writeOnly' and 'readOnly' set to 'true'
Issue ID: v3-validation-schema-write-read-only
Description
One or more properties in the schema you have defined has both writeOnly
and readOnly
properties set to true
. You can define a property to be either "write only" or "read only", but not both.
For more details, see the OpenAPI Specification.
Example
The following is an example of how this issue could look in your API definition:
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"readOnly": true,
"writeOnly": true
},
"name": {
"type": "string"
}
}
}
Remediation
Make sure that you have defined either the schema
or content
property for all parameter
objects in your API.
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"readOnly": true
},
"name": {
"type": "string"
}
}
}