Skip to content

Instantly share code, notes, and snippets.

@udhos
Created May 27, 2022 15:01
Show Gist options
  • Save udhos/2ccc276e6ad6c6abb78f9ec9d590e457 to your computer and use it in GitHub Desktop.
Save udhos/2ccc276e6ad6c6abb78f9ec9d590e457 to your computer and use it in GitHub Desktop.
golang json parser validation

https://github.com/valyala/fastjson - Fast JSON parser and validator for Go.

    var p fastjson.Parser
    v, err := p.Parse(`{
            "str": "bar",
    }`)
    if err != nil {
            log.Fatal(err)
    }
    fmt.Printf("foo=%s\n", v.GetStringBytes("str"))

https://github.com/buger/jsonparser - One of the fastest alternative JSON parser for Go that does not require schema

https://github.com/miladibra10/vjson - vjson is a Go package that helps to validate JSON objects in a declarative way.

https://github.com/olvrng/ujson - A fast and minimal JSON parser and transformer that works on unstructured JSON.

https://github.com/romshark/jscan - jscan provides a high-performance zero-allocation JSON iterator for Go.

https://github.com/zerosnake0/jzon - A high performance json library for Golang

https://github.com/json-iterator/go - A high-performance 100% compatible drop-in replacement of "encoding/json"


validation:

https://github.com/dedalqq/omg.jsonparser - omg.jsonParser is a simple JSON parser with a simple condition validation.

https://github.com/Pungyeon/required - How to make JSON fields required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment