Skip to content

Maybe make stringify function available on the instance of AsyncAPIDocument class #421

Closed

Description

@derberg

The stringify function is at the moment static and available only directly on AsyncAPIDocument. We have the same with parse function from the same class.

from DX point of view, as a dev using the parser, it is confusing that:

  • stringify can't be just used like other methods, asyncapi.stringify()
  • parse is not actually a function outside the class, standalone like parseFromUrl

In templates accessing these with asyncapi.constructor.stringify(asyncapi) feels weird 🤔

or is it just me?

Activity

  1. added
    enhancement
    on Dec 9, 2021
  2. github-actions commented on Apr 9, 2022

    @github-actions

    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 ❤️

  3. derberg commented on Apr 13, 2022

    @derberg
    MemberAuthor

    @magicmatatjahu I totally forgot where is this coming from. I think I talked to you about it when I wanted to use stringify in java template....but they we ended up agreeing that it actually makes sense how it is done now.....do you remember?

    We have https://github.com/asyncapi/parser-js#stringify so I guess topic completed?

  4. magicmatatjahu commented on Apr 13, 2022

    @magicmatatjahu
    Member

    @derberg Yeah, the main point was that this function is not provided from the library and you have to use it as a static method of the class. In parser 2.0.0 it will be a normal imported function like:

    import { stringify, unstringify } from '@asyncapi/parser';
  5. derberg commented on Apr 13, 2022

    @derberg
    MemberAuthor

    ok, then we can close as for current version usage is explained and documented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions