You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
given an attribute set readOnly , and as part of the required list , Spectral raises an error
oas3-valid-media-example , property must have required property "XXX"
Looks the context of usage here in a POST is not taken into account
To Reproduce
leveraging the spec below just run spectral lint
it raises
39:13 error oas3-valid-media-example "value" property must have required property "id" components.examples.Medor.value
openapi: 3.1.0
info:
title: "sample"
version: "sample"
paths:
/dogs:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Dogs'
examples:
Simple:
$ref: '#/components/examples/Medor'
responses:
'200':
description: nice Dog
components:
schemas:
Dogs:
type: object
required:
- id
properties:
id:
readOnly: true
type: integer
name:
type: "string"
examples:
Medor:
description: |
A simple pricing request on a single product.
value:
name : "Medor le chien"
Expected behavior
looking on OAI/learn.openapis.org#101 ,
and the statement
" If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only."
the field should not raise such error
Environment (remove any that are not applicable):
Tested leveraging spectral 6.11.1 on windows
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
given an attribute set readOnly , and as part of the required list , Spectral raises an error
oas3-valid-media-example , property must have required property "XXX"
Looks the context of usage here in a POST is not taken into account
To Reproduce
leveraging the spec below just run spectral lint
it raises
39:13 error oas3-valid-media-example "value" property must have required property "id" components.examples.Medor.value
Expected behavior
looking on OAI/learn.openapis.org#101 ,
and the statement
" If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only."
the field should not raise such error
Environment (remove any that are not applicable):
Tested leveraging spectral 6.11.1 on windows
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: