spec icon indicating copy to clipboard operation
spec copied to clipboard

Support for $ref in examples with $id in the reference

Open nilkanth987 opened this issue 10 months ago • 5 comments

FEATURE REQUEST

As per the discussion with @jonaslagoni on the issue.

Description

Referencing same object multiple times in the message with $id in the referencing object causing issue.

asyncapi: 2.6.0
info:
  title: Test API
  version: 0.0.21
defaultContentType: application/json
channels:
  /test:
    publish:
      message:
        $ref: "#/components/messages/testMessage"
components:
  messages:
    testMessage:
      name: testMessage
      payload:
        type: object
        $id: testMessage
        properties:
          location:
            type: object
            properties:
              from:
                $ref: "#/components/schemas/location"
              to:
                $ref: "#/components/schemas/location"
        examples:
          - location:
              from:
                $ref: "#/components/schemas/location/examples/0"
              to:
                $ref: "#/components/schemas/location/examples/0"
  schemas:
    location:
      type: object
      $id: location
      properties:
        lat:
          type: number
        lng:
          type: number
      examples:
        - lat: 101
          lng: 102

nilkanth987 avatar Sep 21 '23 08:09 nilkanth987

This issue 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 issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue 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 issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Jan 20 '24 00:01 github-actions[bot]

still valid? @jonaslagoni @nilkanth987

AnimeshKumar923 avatar Jan 20 '24 04:01 AnimeshKumar923

I'm having the same issue.

ScottSusman avatar Feb 02 '24 18:02 ScottSusman

@AnimeshKumar923 , Yes issue still persists.

nilkanth987 avatar Feb 03 '24 05:02 nilkanth987