mattermost-plugin-gitlab icon indicating copy to clipboard operation
mattermost-plugin-gitlab copied to clipboard

Guidance For Contributing JSON Parsing

Open scottcc opened this issue 3 years ago • 4 comments

Hey there. Just looking for some pointers on how one would help enhance this plugin to render "prettified" JSON via this excellent plugin.

The reasoning is to work nicely with this commercial Redmine Plugin: Checklists: https://www.redmineup.com/pages/plugins/checklists

This is what it currently "shows up" like:

gitlab-mattermost-redmineup

So - looking for quick recommendations on where in the code would be the best place to start looking, and if there are particular JSON parsing libraries that are recommended (or already in use!), we would highly appreciate knowing the info.

scottcc avatar Sep 02 '20 15:09 scottcc

the following should solve the problem for you.

    error := json.Indent(&prettyJSON, body, "", "\t")
    if error != nil {
        log.Errorf("JSON parse error: ", error)
        App.BadRequest(w)
        return
    }

tw-ayush avatar Oct 06 '20 05:10 tw-ayush

Thank you! Now... where to integrate this in...

scottcc avatar Oct 16 '20 10:10 scottcc

@DHaussermann to invesigate applicable scenario

mickmister avatar Jan 26 '22 21:01 mickmister

How to get JSON data about checklist? @scottcc

masy8 avatar Apr 24 '23 08:04 masy8