-
Notifications
You must be signed in to change notification settings - Fork 187
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
Allow to save a report of the differences encountered #17
Comments
Thanks for using JSONDiff. What would this report look like? What format would you want to save? |
For starters, I thought in a .pdf where you'd have the stats of differences at the top and the json below showing the inequalities inline. |
Thank you for the report. I could develop a print CSS that would allow you to do that. Then you could use the browser to print to CSS. The problem is that the differences would nee to be dynamic and I'm not sure how to make that work in a PDF. Let me think about this some more, but this is a lower priority feature. |
Just so we can get on the same page: what do you mean by “differences would need to be dynamic”? I was thinking in the differences being displayed like Git's diff. That would be static. |
The diff from JSONDiff is different than a diff from Git. JSONDiff will show multiple differences on the same line and the information you will will change as you iterate through your list of differences. |
Hello, can we store the output in a pdf or JSON file? We want to take this difference and create a list for the customers to check what has changed in our jsons in different releases. |
@smitapaloalto, generating a PDF file from a browser is a bit tricky. However, you can print to PDF and get a list of the differences between the two files. Right now the formatting on that PDF really isn't great, but I could develop a print CSS that would make it better. Would that give you the functionality you're looking for? You can also take a look at our readme to see how you can create an URL where you can automatically load files to compare. |
but how to get the results as json? I would like to have the total number of differences and each of the differences as a list. |
@arademaker, Thank you for the suggestion. There's no way to save a report of the differences in JSON now. Can you tell me a little more about your use case and what you'd like to see in the report. Are you looking to incorporate this into a CI process and you want to consume the JSON that way? Are you just looking for an easy way to save the results of multiple comparisons? Is it something else? |
I am using LLM to produce JSON outputs representing data extracted from texts. Since I have some golden data, I also want to evaluate the produced outputs. My code is in Python. Ideally, I would like to call JDD during a loop, passing the expected JSON and the JSON produced by the LLM to it to obtain a similarity score. |
If the code could be loaded as a NodeJS library, we could implement a more straightforward HTTP interface so the Python code could call it and get back the diff as a JSON. |
That use case makes sense. Thank you. The way that JSONDiff is implemented right now depends on running in a browser. However, some people have done ports of JSONDiff to NodeJS. You can do a quick Google search to find them. They may fit your use case better. |
Feature request. Self-explaining title.
Anyhow, congrats for the tool, @zgrossbart.
The text was updated successfully, but these errors were encountered: