You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to reuse Server Objects defined in Components.servers field #705
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:
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:
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?
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. 🙂
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.
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?
Activity
fix(Servers): allow to use union type of Server and Reference objects
fix(Servers): allow to use union type of Server and Reference objects
jonaslagoni commentedon Feb 4, 2022
Good catch!
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. Sostringstill makes sense to use forChannel Item Object.servers. 🙂char0n commentedon Feb 4, 2022
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.
jonaslagoni commentedon Feb 4, 2022
Could definitely be now that you can define servers in multiple places 🤔 Maybe another issue for further discussing that?
char0n commentedon Feb 4, 2022
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
smoya commentedon Apr 27, 2022
This issue can be now closed as it got merged and released. @char0n
char0n commentedon Apr 28, 2022
@smoya thanks, closing.