cdisc-org / conformance-rules-editor

MIT License
6 stars 3 forks source link

Invalid JSON breaks JSONviewer #227

Closed SFJohnson24 closed 2 months ago

SFJohnson24 commented 2 months ago

If a request returns an invalid JSON, the JSONviewer.tsx component breaks.
the request and dataset as well as the result can be found on sharepoint: Documents > unitTesting >FDA Business Rules >FB0101 >for Sam - broken

the resultant rule editor UI looks like this:

image.png

A potential fixes for this: Validate the JSON before passing it to react-json-view. This error in the above case is occurring due to NaN's presence. We could replace NaN's with null before rendering the json and display an error the flags due to NaN's presence. Alternatively, we could Display a message or a fallback UI if the JSON is invalid.

SFJohnson24 commented 2 months ago

https://github.com/cdisc-org/cdisc-rules-engine/pull/713 This ticket has fixed the bug that produced the invalid JSON. Specifically the _replace_nans_in_specified_cols_with_none functionality with grouping