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

fix: add v2-specific root properties to sorting alg #186

Conversation

aeworxet
Copy link
Collaborator

This PR:

  • Adds v2-specific root properties to the algorithm of sorting the resulting bundled AsyncAPI Document's root properties (to bring them into a familiar form.)

  • Extrapolates the location of x- properties in the original AsyncAPI Document, attempting to make as little visual change to the resulting bundled AsyncAPI Document as possible.

Related to #185

Copy link

sonarcloud bot commented Aug 18, 2024

@aeworxet aeworxet marked this pull request as ready for review August 18, 2024 04:55
Copy link
Member

@Souvikns Souvikns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V3 spec files in the examples are not valid, other than that everything is alright.

Generated spec file using this changes

asyncapi: 3.0.0
x-company-attr-1: attr-value-1
x-company-attr-2: attr-value-2
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signupsA
  x-company-version: 1.2.3
channels:
  userSignedup:
    address: user/signedup
    messages:
      userSignedUpMessage:
        payload:
          type: object
          properties:
            displayName:
              type: string
              description: Name of the user
            email:
              type: string
              format: email
              description: Email of the user
  test:
    address: /test
    messages:
      testMessage:
        payload:
          type: string
operations:
  UserSignedUp:
    action: send
    channel:
      $ref: '#/channels/userSignedup'
    messages:
      - $ref: '#/channels/userSignedup/messages/userSignedUpMessage'
  TestOpp:
    action: send
    channel:
      $ref: '#/channels/test'
    messages:
      - $ref: '#/channels/test/messages/testMessage'
components:
  messages:
    TestMessage:
      payload:
        type: string

@aeworxet
Copy link
Collaborator Author

tests/gh-185.yaml is v2.
#185 was opened on a v2 AsyncAPI Document, so I provided a fix for a v2 and used v2 as a test file.

@aeworxet
Copy link
Collaborator Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 5b7fec4 into asyncapi:master Aug 18, 2024
27 checks passed
@aeworxet aeworxet deleted the fix-add-v2-specific-root-properties-to-sorting-alg branch August 18, 2024 05:14
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants