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
spectral-issue-poc.yaml
39:17 error oas3-valid-media-example "message" property must match exactly one schema in oneOf components.examples.poc-sample.value.message
✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints)
Expected behavior
Example is compliant with spec and error should not been reported
Interestingly it does validate correctly if you use a single OAS example:
requestBodies:
poc-request:
description: This is the request body for sending a message. `app_id`, `recipient`, and `message` are all required fields.
content:
application/json:
schema:
$ref: "#/components/schemas/poc-payload-request"
example:
message:
text_message:
text: "This is a text message."
required: true
Describe the bug
When validating an example with
oneOf
schema, anoas3-valid-media-example
error is reported even if correctTo Reproduce
spectral-issue-poc.yaml
file content:And this
ruleset.yaml
file:Expected behavior
Example is compliant with spec and error should not been reported
Environment (remove any that are not applicable):
6.11.1
docker.io/stoplight/spectral@sha256:d55a6be334e3d50e1f3598e1fd4d51c5c1734d033aae295b69efa829420cb979
(https://hub.docker.com/layers/stoplight/spectral/6.11.1/images/sha256-d55a6be334e3d50e1f3598e1fd4d51c5c1734d033aae295b69efa829420cb979?context=explore)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: