Describe the bug
The spectral rule asyncApi2SchemaValidation currently enforces that all examples have the same type as the schema type. However, we believe that there are cases in AsyncAPI, where it is needed to accept string examples regardless of the schema type.
We had to change the version to 2.6.0, as the cli does not support 3.0.0 yet
See the error: 66:11 error asyncapi-schema-examples "0" property type must be object components.schemas.io.github.springwolf.examples.kafka.dtos.XmlPayloadDto.examples[0]
Expected behavior
No error/validation message
Screenshots
N/A
Environment (remove any that are not applicable):
Library version: develop
Additional context
We are embedding xml and/or yaml as string in examples in an AsyncAPI (JSON) document.
Describe the bug The spectral rule
asyncApi2SchemaValidation
currently enforces that allexamples
have the same type as the schematype
. However, we believe that there are cases in AsyncAPI, where it is needed to acceptstring
examples regardless of the schematype
.To Reproduce
spectral lint --ruleset rule.yaml test.yaml
rule.yaml
:extends: "spectral:asyncapi"
2.6.0
, as the cli does not support3.0.0
yet66:11 error asyncapi-schema-examples "0" property type must be object components.schemas.io.github.springwolf.examples.kafka.dtos.XmlPayloadDto.examples[0]
Expected behavior No error/validation message
Screenshots N/A
Environment (remove any that are not applicable):
Additional context We are embedding xml and/or yaml as string in examples in an AsyncAPI (JSON) document.
Relates to https://github.com/asyncapi/spec/issues/1038