Skip to content

Extend the components model with has-like functions #173

@derberg

Description

@derberg

Reason/Context

It would be very useful when working on docs/code generators to have a set of helper functions that let you easily determine if there is or not a specific component added to the components section of the AsyncAPI document and if it has any data. These components are not required and it is not required to have any data in them, so someone can add an empty object for example.

Many models already have useful functions like hasDescription.

Description

  • Add missing functions to Components model:

    • hasMessages
    • hasSchemas
    • hasSecuritySchemes
    • hasParameters
    • hasCorrelationIds
    • hasOperationTraits
    • hasMessageTraits

    Example hasParameter function from Channels model

  • Add missing tests here. Example test is here

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestLabel issues as available for participants of https://hacktoberfest.digitalocean.comenhancementNew feature or requestreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions