-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
unstringify
somehow corrupts the parsed document
#769
Comments
@char0n is it react component related?
this is Parser related code 🤔 did you try to check what is the difference between |
I would say yes. After further detailed investigation I can confirm that isomorpism of stringification works well, here is a proof: import { stringify, unstringify } from '@asyncapi/parser';
// content is fixture from https://github.com/asyncapi/asyncapi-react/issues/769#issue-1902895557
const { document } = await parser.parse(content);
const strigified = stringify(document);
const unstrigified = unstringify(strigified);
console.assert(strigified === stringify(unstrigified)); Now when I do following, we're just fine: <AsyncApiReactComponent schema={document} /> But when I do following I see errors and renderer fails to render: <AsyncApiReactComponent schema={unstrigified} /> Apparently stringing and unstrigifing the |
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 ❤️ |
I need to check this with latest version of react component, but last I've checked, this issue is still there. |
Describe the bug
unstringify
somehow corrupts the parsed document and results in failing to render theAsyncApiReactComponent
.How to Reproduce
Dependencies versions:
Fixture:
Code that parses:
Feeding to React component:
This results in:
Expected behavior
I would expect that there is a true isomorphism between
stringify
andunstrigify
and that following equation applies:document
==unstrigify(strigify(document))
The text was updated successfully, but these errors were encountered: