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

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

Closed
Tracked by #735
char0n opened this issue Feb 4, 2022 · 6 comments
Closed
Tracked by #735

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

char0n opened this issue Feb 4, 2022 · 6 comments
Labels

Comments

@char0n
Copy link
Collaborator

char0n commented Feb 4, 2022

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.

@jonaslagoni
Copy link
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. 🙂

@char0n
Copy link
Collaborator Author

char0n commented Feb 4, 2022

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.

@jonaslagoni
Copy link
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?

@char0n
Copy link
Collaborator Author

char0n commented 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
Copy link
Member

smoya commented Apr 27, 2022

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

@char0n
Copy link
Collaborator Author

char0n commented Apr 28, 2022

@smoya thanks, closing.

@char0n char0n closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants