Skip to content

Unable to reuse Server Objects defined in Components.servers field #705

Closed

Description

@char0n

Hello everybody,

While implementing 2.3 support into tooling I've noticed couple of inconsistencies/errors in the specification.
As AsyncAPI 2.3.0 introduced new Components.servers field, there is no way how Server Objects defined in this map can be used later in the definition.

Usage in Servers Object

I assume first intended usecase was to reference Server Object defined in Components.servers field in Servers Object. This intention is clear from the release article:

image

What the article is showing is not possible according to the spec as the Servers Object pattern field only allows Server Object and not Server Object | Reference Object.

Usage in Channel Item Object.servers field

With this I'm not 100% sure of the intended usage. The specification says following:

image

This limits using referencing Server Object to ones defined Servers Object (by name). Should we allow referencing the Server Object even from Components.servers field as well?

I'll provide a PR in a couple of minutes.

Activity

  1. jonaslagoni commented on Feb 4, 2022

    @jonaslagoni
    Member

    Good catch!

    This limits using referencing Server Object to ones defined Servers Object (by name). Should we allow referencing the Server Object even from Components.servers field as well?

    That would be a new feature, as regardless of what you define in your components sections, servers are not "active" until referenced under servers. They are nothing but reusable chunks. So string still makes sense to use for Channel Item Object.servers. 🙂

  2. char0n commented on Feb 4, 2022

    @char0n
    MemberAuthor

    That would be a new feature, as regardless of what you define in your components sections, servers are not "active" until referenced under servers. They are nothing but reusable chunks. So string still makes sense to use for Channel Item Object.servers. slightly_smiling_face

    Right, I assumed it was like you explained but I'd rather asked ;] Having said that, maybe it warrants clarification in the spec? But maybe not...not sure.

  3. jonaslagoni commented on Feb 4, 2022

    @jonaslagoni
    Member

    Right, I assumed it was like you explained but I'd rather asked ;] Having said that, maybe it warrants clarification in the spec? But maybe not...not sure.

    Could definitely be now that you can define servers in multiple places 🤔 Maybe another issue for further discussing that?

  4. char0n commented on Feb 4, 2022

    @char0n
    MemberAuthor

    Yeah I think it's worth discussing further. If agreed, I'll extract part of this issue regarding servers to a new one.

    Second point extracted to #712

  5. smoya commented on Apr 27, 2022

    @smoya
    Member

    This issue can be now closed as it got merged and released. @char0n

  6. char0n commented on Apr 28, 2022

    @char0n
    MemberAuthor

    @smoya thanks, closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions