Description
The library provides a JSONC (json with comments) to JSON streamer. It supports multiline comments ( /* Comment */) and one-line comments ( // Comment ).
JSONcJSON alternatives and similar packages
Based on the "JSON" category.
Alternatively, view JSONcJSON alternatives based on common mentions on social networks and blogs.
-
jsonparser
One of the fastest alternative JSON parser for Go that does not require schema -
fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection -
marshmallow
Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed. -
jsondiff
Compute the diff between two JSON documents as a series of RFC6902 (JSON Patch) operations -
JSON-to-Proto
convert JSON to Protocol Buffers online in your browser instantly -
ujson
µjson - A fast and minimal JSON parser and transformer that works on unstructured JSON -
mapslice-json
Go MapSlice for ordered marshal/ unmarshal of maps in JSON -
ask
A Go package that provides a simple way of accessing nested properties in maps and slices. -
Better Parsing of Unstructured JSON in Go
An error propagating JSON parsing library for Go -
go-jsonerror
Small package which wraps error responses to follow jsonapi.org -
epoch
Contains primitives for marshaling/unmarshaling Unix timestamp/epoch to/from built-in time.Time type in JSON -
omg.jsonparser
The simple JSON parser with validation by condition -
go-parameters
:blue_book: Easily parse incoming parameters and values from an HTTP request
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of JSONcJSON or a related project?
Popular Comparisons
README
JSONcJSON
The library provides a JSONC (json with comments) to JSON streamer. It
supports multiline comments ( /* Comment */
) and one-line comments
( // Comment
).
For example, it translates JSON with comments:
{
/*
JSONcJSON
=^._.^= ∫
*/
"Hello": "world" // In-line comments are also supported.
}
to a valid JSON:
{
"Hello": "world"
}
Installing:
go get github.com/hedhyw/jsoncjson
Usage example:
More [examples](./example_test.go).
// Converting jsonc to json and decoding.
const in = `
{
"Hello": "world"
/* Perhaps the truth depends on a walk around the lake. */
}
`
// The reader can be anything.
// For example: file, strings.NewReader(), bytes.NewReader(), ...
var r = jsoncjson.NewReader(strings.NewReader(in))
var data map[string]interface{}
_, = json.NewDecoder(r).Decode(&data)
fmt.Printf("%+v\n", data) // map[Hello:world].