Popularity
0.9
Declining
Activity
0.0
Declining
4
2
2
Programming language: Go
License: MIT License
Tags:
Json
omg.jsonparser alternatives and similar packages
Based on the "JSON" category.
Alternatively, view omg.jsonparser 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 -
epoch
Contains primitives for marshaling/unmarshaling Unix timestamp/epoch to/from built-in time.Time type in JSON -
go-jsonerror
Small package which wraps error responses to follow jsonapi.org -
go-parameters
:blue_book: Easily parse incoming parameters and values from an HTTP request -
JSONcJSON
JSONC (json with comments) to JSON translator for Golang. -
jsonToStruct
Golang code generator for creating struct from json. -
jsonhandlers
JSON library to expose simple handlers that lets you easily read and write json from various sources.
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of omg.jsonparser or a related project?
Popular Comparisons
README
omg.jsonParser
omg.jsonParser is a simple JSON parser with a simple condition validation. It's a wrapper on standard go JSON lib. With it help you can add the validation condition via golang structure fields tags.
Example
package main
import (
"fmt"
"github.com/dedalqq/omg.jsonparser"
)
func main() {
jsonData := `{"name": ""}`
st := struct {
Name string `json:"name,notEmpty"` // added notEmpty for enable validation for it field
}{}
err := jsonparser.Unmarshal([]byte(jsonData), &st)
if err != nil {
fmt.Println(err.Error()) // print: value [name] must be not empty
}
}
Tag struct
json:"[name][,option]..."
Tag examples
Here are some the tag examples:
package main
type data struct {
F1 string `json:"f1,notEmpty"` // the field must be not empty but can be "null" or may not exist
F2 string `json:"f2,notEmpty,required"` // the field is required and must be not empty but may be the "null" value
F3 string `json:"f3,notEmpty,notNull"` // the field must be not empty and not "null" but may not exist
F4 []string `json:"f4,notNull,min:3"` // the field must be not "null" and contains 3 or more items but may not exist
}
Available tags options
Name | Types | Description |
---|---|---|
required |
any | The field must be exist with any value or null |
notEmpty |
any | The field can be not exist but if exist value must be not zero value but can be null |
notEmpty |
slice | The field must have one element or more but may be null or not exist |
notNull |
any | The field should not be null, but may not exist |
uniq |
[]string | The strings slice must contains only unique strings |
min:n |
slice | The slice must have n items or more |
max:n |
slice | The slice must have n items or less |
min:n |
string | The string must have n runes or more |
max:n |
string | The string must have n runes or less |
min:n |
int/uint | The value must be equals n or more |
max:n |
int/uint | The value must be equals n or less |