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

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

Closed
Tracked by #481
derberg opened this issue Dec 9, 2021 · 4 comments
Closed
Tracked by #481
Labels
enhancement New feature or request stale

Comments

@derberg
Copy link
Member

derberg commented Dec 9, 2021

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?

@derberg derberg added the enhancement New feature or request label Dec 9, 2021
This was referenced Mar 3, 2022
@github-actions
Copy link

github-actions bot commented Apr 9, 2022

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

@github-actions github-actions bot added the stale label Apr 9, 2022
@derberg
Copy link
Member Author

derberg commented Apr 13, 2022

@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?

@magicmatatjahu
Copy link
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';

@derberg
Copy link
Member Author

derberg commented Apr 13, 2022

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

@derberg derberg closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants