Open LasneF opened 1 year ago
Also having this problem with examples
and a value that's a string.
responses:
'201':
description: Booking successful
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Booking'
- properties:
links:
$ref: '#/components/schemas/Links-Self'
examples:
new_booking:
summary: New Booking
value: |-
{
"id": "{{ uuid() }}",
"trip_id": "{{ request.body/trip_id }}",
"passenger_name": "{{ request.body/passenger_name }}",
"has_bicycle": {{ request.body/has_bicycle }},
"has_dog": {{ request.body/has_dog }},
"links": {
"self": "https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb"
}
}
This is allowed by the spec, and its eneded for using Microcks mocking tool, but I get this error:
370:26 error oas3-valid-media-example "value" property type must be object
Describe the bug give an API Spec with a return content type set to application/xml spectral raise an error stating that example must be an object
notice that the file looks correct , and is correctly rendered by editor.swagger.io
To Reproduce given the API spec below
Error below is raised 18:44 error oas3-valid-media-example "example" property type must be object paths./pet.get.responses[200].content.application/xml.example
Expected behavior No Error raised ,