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

conversion to v3 do not preserve strign quotes #197

Open
derberg opened this issue Oct 10, 2023 · 6 comments
Open

conversion to v3 do not preserve strign quotes #197

derberg opened this issue Oct 10, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@derberg
Copy link
Member

derberg commented Oct 10, 2023

Example reference in single quotes prior v3 -> https://github.com/asyncapi/spec/blob/master/examples/social-media/backend/asyncapi.yaml#L9

After conversion it becomes ../common/servers.yaml#/websiteWebSocketServer without quotes

Problem is that some editors, like Studio for example, interprets #/websiteWebSocketServer as a YAML comment

cc @magicmatatjahu @jonaslagoni

@derberg derberg added the bug Something isn't working label Oct 10, 2023
@derberg
Copy link
Member Author

derberg commented Oct 10, 2023

it is not only with refs, also location

@ItshMoh
Copy link
Contributor

ItshMoh commented Sep 4, 2024

still relevant

cc: @derberg @jonaslagoni

Copy link
Member Author

derberg commented Sep 17, 2024

I think so, yes

@ItshMoh
Copy link
Contributor

ItshMoh commented Sep 25, 2024

https://github.com/asyncapi/converter-js/blob/38d38a709552da0d30c198e883905a6444d87d34/src/utils.ts#L72C1-L72C7

Hey @jonaslagoni , for this bug i have changed the above function to

export function createRefPath(...paths: Array<string | number>) {
  return "'#/" + paths.map(String).map(tilde).join('/') + "'";
}

such that it preserves the double quotes, This is the correct solution right ?

@jonaslagoni
Copy link
Member

@ItshMoh whatever works, add a test and see it in action 🙂

@ItshMoh
Copy link
Contributor

ItshMoh commented Sep 25, 2024

Hey @jonaslagoni I think this issue is resolved. The asyncapi v3 is already giving $ref in ' ' . Here is the link to output file of conversion of asyncapi from v2 to v3. Here $ref is already in ' ' .

But investigating the above issue. I have found out that the async api test file is giving the below error in studio. should i open a issue in studio or is this the error of converter.

The error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants