You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/01/06 22:26:22 UTC

[GitHub] [druid] vogievetsky commented on a change in pull request #10710: fix web-console show json bug

vogievetsky commented on a change in pull request #10710:
URL: https://github.com/apache/druid/pull/10710#discussion_r552995684



##########
File path: web-console/src/components/show-json/show-json.tsx
##########
@@ -41,7 +41,13 @@ export const ShowJson = React.memo(function ShowJson(props: ShowJsonProps) {
       const resp = await Api.instance.get(endpoint);
       let data = resp.data;
       if (transform) data = transform(data);
-      return typeof data === 'string' ? data : JSON.stringify(data, undefined, 2);
+      return typeof data === 'string'
+        ? data
+        : JSON.stringify(
+            data,
+            (_, value) => (typeof value === 'bigint' ? value.toString() : value),

Review comment:
       This is cool but it would be better to use the stringify function that comes with `json-bigint`
   
   Just do `import * as JSONBig from 'json-bigint-native';`
   
   and then replace all `JSON.stringify` with `JSONBig.stringify`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org