Format my JSON
-
Is there a way to provoke Notepad++ to validate my JSON? Here’s an example of a site that does this:
https://jsonformatter.curiousconcept.com/ -
my way is to use python script plugin and call
json.loads(editor.getText())
but what about using
JSON VIewer and JSTool plugin? Do those help in this case? -
I do what @Ekopalypse does to some extent - I use an external program
jq
to validate JSON. I have JSTool installed and while good, it does not validate JSON, it can format it nicely and provides a tree viewer though.Cheers.
-
@Michael-Vincent
I should clarify, when I say “external” - I use an NppExec script called “compile” that based on the extension runs an external program. In this case, .json launches thejq
command on the current file.Cheers.
-
These look great but I would love to have a pull-down that would do the validation … more than the formatting.
-
I would love to have a pull-down that would do the validation
If that’s a feature request, I don’t think you’ll ever see that type of thing inside of Notepad++. But, if you work with some of the earlier suggestions, you can possibly create something that you could tie to perhaps a toolbar button or a keycombo or a menu entry…
-
Download and install this plugin JSToolNpp ,Then perform operations like this Plugins | JSTool | JSFormat.
If you don’t want to install plugins, you can perform JSON beautification operations on JSON Formatter -
This site you can validate, format and copy path and leaf
https://jsonformatter.tech/
-
Did you really need to come 4 years later to give a URL to a random website when the problem is solved with Notepad++ and the JSToolNpp plugin mentioned then (or the JsonTools plugin which also exists now).
(your link was de-linkified, to avoid this forum becoming a honeypot for posting URLs to random sites unrelated to Notepad++)