Skip to content

all{componentName} method for each component type #109

@KhudaDad414

Description

@KhudaDad414

Reason/Context

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:

allServers()
allChannels()
allOperations()
allMessages()
allSchemas()

To optimize our process, we need to add the following methods:

allSecuritySchemes()
allServerVariables()
allParameters()
allCorrelationIds()
allReplies()
allReplyAddresses()
allTags()
allOperationTraits()
allMessageTraits()
allServerBindings()
allChannelBindings()
allOperationBindings()
allMessageBindings()

These enhancements would ensure we effectively leverage the parser's capabilities by Optimizer and maybe other tools as well.

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