microcks: AsyncAPI version 2.6.0 is not supported

When using version 2.6.0 of the AsyncAPI document in the Microcks UI, I keep getting the following error: Error: Version 2.6.0 is not supported.

Any idea why?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

šŸ‘‹ @AceTheCreator

Welcome to the Microcks community! šŸ’–

Thanks and congrats šŸŽ‰ for opening your first issue here! Be sure to follow the issue template or please update it accordingly.

šŸ“¢ If you’re using Microcks in your organization, please add your company name to this list. šŸ™ It really helps the project to gain momentum and credibility. It’s a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post ā€œJoin the Microcks Adopters list and Empower the vibrant open source Community šŸ™Œā€

Hope you have a great time there!

🌟 ~~~~~~~~~ 🌟

šŸ“¢ If you like Microcks, please ⭐ star ⭐ our repo to support it!

šŸ™ It really helps the project to gain momentum and credibility. It’s a small contribution back to the project with a big impact.

I’ll create an issue about it and ask for the maintainer’s opinion if it’ll be worth backporting this.

Need some extra checks to see how to integrated fix from web components and what are the consequence on Microcks side.

Ok but as I understand, it means that it may then break v3 document representation that holds functions once the spectral rules are ported to v3…

It could be nice not to fail violently like on v2 but to just put a warning saying your example is not valid.

Otherwise people will think it’s a Microcks issue. What do you think?

I’ll keep a close eyes for the implementation to ensure this doesn’t happen

Hey @AceTheCreator

I’ve done some complementary tests and have found some interesting results… It seems that the 1.4.5 version of the components behaves a bit differently on examples rendering depending on the version of the spec. That’s why I thought it was not correctly working for previous versions.

Let’s me explain what I’ve seen.

Let’s imagine I’ve got this AsyncAPI v3.0.0:

asyncapi: 3.0.0
id: 'urn:io.microcks.example.user-signedup'
info:
  title: User signed-up API
  version: 0.3.0
  description: Sample AsyncAPI for user signedup events
defaultContentType: application/json
channels:
  user-signedup:
    description: The topic on which user signed up events may be consumed
    messages:
      userSignedUp:
        $ref: '#/components/messages/userSignedUp'
operations:
  publishUserSignedUps:
    action: 'send'
    channel:
      $ref: '#/channels/user-signedup'
    summary: Receive information about user signed up
    messages:
      - $ref: '#/channels/user-signedup/messages/userSignedUp'
components:
  messages:
    userSignedUp:
      description: An event describing that a user just signed up
      traits:
        - $ref: '#/components/messageTraits/commonHeaders'
      headers:
        type: object
        properties:
          sentAt:
            type: string
            format: date-time
            description: Date and time when the event was sent
      payload:
        type: object
        additionalProperties: false
        properties:
          fullName:
            type: string
          email:
            type: string
            format: email
          age:
            type: integer
            minimum: 18
      examples:
        - name: laurent
          summary: Example for Laurent user
          headers:
            my-app-header: 23
            sentAt: "2020-03-11T08:03:28Z"
          payload:
            fullName: Laurent Broudoux
            email: "laurent@microcks.io"
            age: 41
        - name: john
          summary: Example for John Doe user
          headers:
            my-app-header: 24
            sentAt: "2020-03-11T08:03:38Z"
          payload:
            fullName: John Doe
            email: '{{randomEmail()}}'
            age: 36
  messageTraits:
    commonHeaders:
      headers:
        type: object
        properties:
          my-app-header:
            type: integer
            minimum: 0
            maximum: 100
      examples:
        - laurent:
            my-app-header: 21
        - yacine:
            my-app-header: 22

You see that the email address of one example ('{{randomEmail()}}') is not conformant to the spec as it should have the email format. However, rendering of documentation is ok as illustrated below:

Capture d’écran 2024-04-24 aĢ€ 10 14 13

Now if I’ve got the same error in an AsyncAPI v2.1.0 spec:

asyncapi: '2.1.0'
id: 'urn:io.microcks.example.user-signedup'
info:
  title: User events API
  version: 0.1.0
  description: Sample AsyncAPI for user related events
  contact:
    name: Laurent Broudoux
    url: https://github.com/lbroudoux
    email: laurent.broudoux@gmail.com
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
defaultContentType: application/json
channels:
  user/events:
    subscribe:
      message:
        $ref: '#/components/messages/UserSignedUp'
components:
  messages:
    UserSignedUp:
      payload:
        type: object
        properties:
          displayName:
            type: string
            description: Name of the user
          email:
            type: string
            format: email
            description: Email of the user
      examples:
        - name: Laurent
          summary: Example for Laurent user
          payload:
            displayName: Laurent Broudoux
            email: laurent@microcks.io
        - name: Random
          summary: Example for Random user
          payload:
            displayName: '{{randomFullName()}}'
            email: '{{randomEmail()}}'

The rendering fails, only displaying a white screen with no messages, either on the developer console. Remove the format: email directive and rendering is OK.

And I think that’s why we kept the older version of the web component for previous spec versions: the older version might be more permissive with older specs errors.

Obviously, consistent behavior for the different spec versions would be better. Would it be worth creating an issue for this in AsyncAPI web component? Now that efforts are focused on 3.0, I’m not sure if it’s worth backporting this… What do you think?

I did some quick tests, and it appears that the latest 1.4.x release of the component supports the 2.6.0 version of the spec, but it fails to render previous versions of the spec with no information message.

We’d probably adjust our rendering criterion for documentation with:

  • < 2.6 => render with version 0.24.23 of the component
  • >= 2.6 => render with version 1.4.5 of the component

Do you know who could help on this and confirm that versions before 2.6 are no longer supported but 1.x versions of the react component?

I’ll take a look at the react-component and write back!