Community
    • Login

    Format my JSON

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 7 Posters 6.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chuck HerrickC Offline
      Chuck Herrick
      last edited by

      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/

      EkopalypseE Michael VincentM Estevao JordaoE 3 Replies Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @Chuck Herrick
        last edited by

        @Chuck-Herrick

        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?

        1 Reply Last reply Reply Quote 2
        • Michael VincentM Offline
          Michael Vincent @Chuck Herrick
          last edited by

          @Chuck-Herrick

          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 VincentM 1 Reply Last reply Reply Quote 3
          • Michael VincentM Offline
            Michael Vincent @Michael Vincent
            last edited by

            @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 the jq command on the current file.

            Cheers.

            1 Reply Last reply Reply Quote 1
            • Chuck HerrickC Offline
              Chuck Herrick
              last edited by

              These look great but I would love to have a pull-down that would do the validation … more than the formatting.

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA Offline
                Alan Kilborn @Chuck Herrick
                last edited by Alan Kilborn

                @Chuck-Herrick

                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…

                1 Reply Last reply Reply Quote 0
                • kate nalaniK Offline
                  kate nalani
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 1
                  • Estevao JordaoE Offline
                    Estevao Jordao @Chuck Herrick
                    last edited by

                    @Chuck-Herrick

                    This site you can validate, format and copy path and leaf

                    https://jsonformatter.tech/

                    PeterJonesP 1 Reply Last reply Reply Quote -2
                    • PeterJonesP Offline
                      PeterJones @Estevao Jordao
                      last edited by

                      @Estevao-Jordao ,

                      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++)

                      1 Reply Last reply Reply Quote 2

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors