parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

fix: always allow schema string examples

Open timonback opened this issue 1 year ago • 2 comments

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)

  • https://github.com/asyncapi/parser-js/issues/997
  • https://github.com/stoplightio/spectral/issues/2624

timonback avatar Jun 07 '24 12:06 timonback

This pull request has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Oct 17 '24 00:10 github-actions[bot]

⚠️ No Changeset found

Latest commit: 8cc8c6a662e565eae6263ca8b15d3ea7574df131

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 01 '24 09:11 changeset-bot[bot]

Bump.

To resolve https://github.com/asyncapi/parser-js/issues/997#issuecomment-2367036182

Aligns with spectral parser, where the change has been merged via https://github.com/stoplightio/spectral/pull/2625#event-14518858703 and was approved by @jonaslagoni

timonback avatar Nov 01 '24 09:11 timonback

Just some linting problems ✌️

PR is updated

timonback avatar Nov 01 '24 13:11 timonback

/rtm

jonaslagoni avatar Nov 01 '24 13:11 jonaslagoni

:tada: This PR is included in version 3.2.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Dec 04 '24 15:12 asyncapi-bot