[BUG] stringify does not create a valid asyncApi-document (invalid $ref format) #1074
Open
2 tasks done
Labels
bug
Something isn't working
Describe the bug.
I want to use the parser to load, modify and save an
asyncApi.yaml
.Initially, I expected
stringify(parse(file))
to equal the input-file. Unfortunately, referenced objects are not placed where they would make sense (and where they originally were) but where they first appear.Moreover, the result does not even seem to be a valid asyncApi-document.
Do you have any ideas, how to generate a valid asyncApi-file?
Expected behavior
I would expect
stringify(parse(file))
to be valid and at least similar to the input.Further, defining schemas where they first appear in the document and reference them from
#/components/schemas
seems wrong to me.Screenshots
none required
How to Reproduce
Consider the following example:
asyncApi_min_v3.yaml
When I run:
the following file is created:
asyncApi_parsed-and-stringified.yaml
This is not accepted by asyncapi studio. To be valid, I need to adjust the references from
to
(add line-break, add space after
$ref:
, add '', use#/
instead of$.
)Please correct me, if I'm doing something wrong.
🥦 Browser
None
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
None
Thank you in advance
The text was updated successfully, but these errors were encountered: