asyncapi-payload-unsupported-schemaFormat
Message schema validation is only supported with default unspecified "schemaFormat".
- Applies to
schemaFormat- Selects
$.components.messageTraits.*$.components.messages.*$.channels[*][publish,subscribe].message- Function
undefined- Specs
- AsyncAPI 2.x
Use it
This rule ships with OpenLint in spectral:asyncapi. Extending the ruleset turns it on:
extends: spectral:asyncapi
rules:
asyncapi-payload-unsupported-schemaFormat: info # or off, or another severity
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
asyncapi-payload-unsupported-schemaFormat:
description: >-
Message schema validation is only supported with default unspecified
"schemaFormat".
severity: info
recommended: true
formats:
- AsyncAPI 2.x
given:
- $.components.messageTraits.*
- $.components.messages.*
- '$.channels[*][publish,subscribe].message'
then:
field: schemaFormat
function: undefined
About this rule
AsyncAPI can support various schemaFormat values. When unspecified, one of the following will be assumed:
application/vnd.aai.asyncapi;version=2.0.0 application/vnd.aai.asyncapi+json;version=2.0.0 application/vnd.aai.asyncapi+yaml;version=2.0.0
At this point, explicitly setting schemaFormat is not supported by Spectral, so if you use it this rule will emit an info message and skip validating the payload.
Other formats such as OpenAPI Schema Object, JSON Schema Draft 07, and Avro will be added in various upcoming versions.