Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I made a tool which fixes broken JSONs (prakhar897.github.io)
29 points by prakhar897 6 months ago | hide | past | favorite | 14 comments



This should likely have a disclaimer that JSON you paste into the tool can be stored. I was intentionally providing bad input and was presented with a message, “Sorry, I couldn't parse this JSON. I've logged it and will try to add it to the list of use-cases. Please let me know if this error persists.”


It doesn’t. That’s just a placeholder message for now :)


It would be your fault for trusting a random website


Seems useful as I do occasionally get broken JSON from LLM responses and would like an easy solution to that. However, I don't see this as something I would use an API for. Especially seeing the supported fixes are relatively simple. Seems like it should be a python package. Maybe if you could somehow handle a comparison with a pre-specified json schema that would make it more valuable.


I have a simpler thing I do with a wrapper around jsonlint. Just pass a filename and it opens my editor (Sublime) right to the line and column of the error.

https://github.com/luckman212/json-lint-sh


Very cool! One note: the random sample marked: 'Using a string "true" instead of a boolean true' leaves "true" as a string after parsing, instead of converting to an actual boolean.


I like such professional and compact tools. Doing one thing and doing it well.


Nice tools,Thanks.and does the broken json repaired by ai?


Nope. I’ve written a custom parser to manually handle possible cases.


Wouldn't it be easier if we ask chatGPT to fix?


The problem is created largely because ChatGPT responses are unreliable. and tokens are expensive.


This is useful, I often have this problem too


Just imagine if we didn’t use heuristics to fix arbitrary inputs and instead we used some sort of learning algorithm that was trained on producing valid looking json - then all we’d need to do is add a prompt and start with some random noise… :P


I've written a parser to handle all the cases. I can add a custom model/LLM if the parser fails to improve reliability even further if parser fails.

I believe ML Algos are a blackbox and non deterministic. So, they might fail for any given input and can't be trusted as a primary source of truth.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: