-
Notifications
You must be signed in to change notification settings - Fork 10
fix: add check for nested empty JSON objects #457
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
Conversation
|
|
||
| if (entry.value.kind == JSONValueKind.OBJECT) { | ||
| const object = entry.value.toObject(); | ||
| for (let i = 0; i < object.entries.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This for loop is a mistake. We shouldn’t keep it, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I don't have the history of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Le-Caignec do you remember why was it added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no i think it's an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug that causes rendering issues when encountering empty JSON objects by adding a check to prevent unnecessary recursive parsing.
- Removes a redundant loop over object entries and adds a condition to check for non-empty objects before recursion.
- Improves both the clarity and efficiency of the recursive parsing function.
PierreJeanjacquot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… improved test setup
| runs-on: | ||
| group: Azure_runners | ||
| labels: [ self-hosted, Linux, X64 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need runner connected to iexec infra to make deployment
| it('should work as expected', async () => { | ||
| // --- GIVEN | ||
| const dataProtector = new IExecDataProtector(); | ||
| const dataProtector = new IExecDataProtector(...getTestConfig()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was connected to the production subgraph, causing the test to fail.
…nce; update test to reflect changes in expected output
…r expected schema output
This file is designed to parse the JSON schema emitted on-chain and display it in the subgraph. Like that :

Bug Description
The issue arises when some fields in the schema contain an empty JSON object (e.g.,
"field":{}). These cases are not currently handled properly and result in a rendering/display bug.Fix Summary
This fix addresses the issue by correctly handling fields with empty JSON objects, ensuring the schema is displayed as expected.