-
Notifications
You must be signed in to change notification settings - Fork 192
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
fix: logic for 2D JSON data detection #840
Conversation
APIX Tests 1 files 77 suites 2m 57s ⏱️ Results for commit bde6a98. |
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.
Got a bunch of questions to answer before approving
* @param json to analyze | ||
*/ | ||
const getTypes = (json: any) => { | ||
const types = [new Set<ItemType>(), new Set<ItemType>()] |
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.
can json be a string, number, boolean or date?
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.
the value passed in that we expect to be JSON could be any type
const data = json2Csv(content) | ||
const showGrid = isColumnar(data.data) | ||
const json = JSON.stringify(JSON.parse(response.body), null, 2) | ||
const parsed = JSON.parse(response.body) |
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.
What if body is not JSON? parse will fail
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.
the pickResponseHandler
decides what renderer to use. If we're in this function it has to be a json:
APIX Tests 1 files 77 suites 2m 12s ⏱️ Results for commit 6ccb3d8. |
APIX Tests 1 files ±0 77 suites ±0 2m 10s ⏱️ -40s Results for commit dbbf919. ± Comparison against base commit eb1731f. This pull request removes 1 and adds 4 tests. Note that renamed tests count towards both.
|
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, 🚢 it!
Only truly 2D JSON data should have a grid. This fixes erroneous DataGrid rendering