Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apidom-ls: False positive for linting rule ASYNCAPI2_MESSAGE_TRAIT_FIELD_EXAMPLES_ITEMS_TYPE #3761

Closed
CalemRoelofsSB opened this issue Jan 31, 2024 · 2 comments
Assignees
Labels
ApiDOM AsyncAPI 2.x bug Something isn't working

Comments

@CalemRoelofsSB
Copy link
Contributor

Q&A (please complete the following information)

  • OS: MacOS Sonoma 14.3
  • Browser: Firefox 122.0
  • ApiDOM version: 0.87.0
  • Swagger/OpenAPI version: AsyncAPI 2.X.0

Describe the bug you're encountering

When testing the below AsyncAPI definition on https://editor-next.swagger.io/ v5.0.0-alpha.87, the linting rule 'examples' must be an array of Message Example Objects is triggered, despite the objects in the examples array conforming to the JSON Schema specified in the parent object.

asyncapi: '2.6.0'
info:
  title: Title
  version: '1.0.0'
  description: 'description'
channels: {}
components:
  messageTraits:
    commonHeaders:
      headers:
        type: object
        properties:
          my-app-header:
            type: integer
            minimum: 0
            maximum: 100
      examples: 
        - headers: 
            my-app-header: 100

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://editor-next.swagger.io/
  2. Paste in the above AsyncAPI definition

Expected behavior

No validation error appears as the content of $.components.messageTraits.commonHeaders.examples is spec compliant

Screenshots

image

@char0n
Copy link
Member

char0n commented Jan 31, 2024

Confirmed that refracting layer creates semantic ApiDOM representation correctly. The issue must come from the linting.

@char0n
Copy link
Member

char0n commented Jan 31, 2024

Addressed in #3762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ApiDOM AsyncAPI 2.x bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants