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
all{componentName} method for each component type #109
In our Optimizer, the current design requires us to manually locate each component in a central location. This approach essentially replicates what the parser does when navigating between AsyncAPI versions, indicating that it's far from ideal.
However, the parser is capable of providing all the components the Optimizer requires for its logic without necessitating duplication. Certain existing functions significantly aid this process, and we could further streamline it by introducing additional functions for different component types.
Description
In order to improve this situation without making drastic changes, I propose that we introduce an all{componentName} function for every component that can be declared in the components section.
The Document object of the parser already supports the following methods:
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thinking if it would make sense to additionally add mirror methods to those new all{componentName} but returning the in-use objects. For example, adding as well the mirror method of allServerBindings called serverBindings that returns the bindings for the servers in use (not in components).
Not pretty sure if it has a use case, just trying to be consistent, but no strong feelings. WDYT @jonaslagoni ?
Thinking if it would make sense to additionally add mirror methods to those new all{componentName} but returning the in-use objects...
It would make sense to have those methods for all of the components in the root. we already have operations(), channels(), servers() even messages() why not others? 🤷 it would definitely add consistency for all components:
allMessages() ---> used and unused components. messages() ---> used messages.
regarding the use case, it would be useful at least for us(in Optimizer). we are currently grouping them based on their jsonpath. so I am sold.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Activity
KhudaDad414 commentedon Aug 30, 2023
cc: @jonaslagoni @smoya
[-]Add `all{componentName}` method for each component type[/-][+]all{componentName} method for each component type[/+]github-actions commentedon Mar 3, 2024
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
smoya commentedon Mar 7, 2024
Transferred this issue to the parser-api repository as this is a decision on the API side.
BTW, I don't see a problem adding those new methods to the root of the document.
The process will be the following:
@KhudaDad414 are you ok taking this?
cc @jonaslagoni
KhudaDad414 commentedon Mar 20, 2024
Sure. I am going to open the PRs.
smoya commentedon Mar 22, 2024
Thinking if it would make sense to additionally add mirror methods to those new
all{componentName}but returning the in-use objects. For example, adding as well the mirror method ofallServerBindingscalledserverBindingsthat returns the bindings for the servers in use (not in components).Not pretty sure if it has a use case, just trying to be consistent, but no strong feelings. WDYT @jonaslagoni ?
jonaslagoni commentedon Mar 22, 2024
Use-case over everything IMO, cause you are forcing more work across parsers (in the future), so it has to have reason.
KhudaDad414 commentedon Mar 23, 2024
@smoya PRs are ready for review: asyncapi/parser-js#969, #111 🙇
smoya commentedon Apr 8, 2024
Agree. cc @KhudaDad414
KhudaDad414 commentedon Apr 18, 2024
It would make sense to have those methods for all of the components in the root. we already have
operations(),channels(),servers()evenmessages()why not others? 🤷 it would definitely add consistency for all components:allMessages()---> used and unused components.messages()---> used messages.regarding the use case, it would be useful at least for us(in Optimizer). we are currently grouping them based on their jsonpath. so I am sold.
should I go ahead and add them as well?
github-actions commentedon Mar 19, 2025
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️