asyncapi / parser-js

AsyncAPI parser for Javascript (browser-compatible too).
115 stars 91 forks source link

fix: always allow schema string examples #1007

Open timonback opened 1 month ago

timonback commented 1 month ago

Description

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.

To Reproduce:

  1. Use the AsyncAPI document: https://github.com/asyncapi/spec/issues/1038#issuecomment-1969489452
  2. Open it in AsyncAPI studio
  3. 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]

Related issue(s)

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud