Documentation ¶
Index ¶
- Variables
- func Diff(a, b string) []string
- func JsonToSpec(data []byte, spec interface{}) error
- func ObjectDiff(a, b, objectAPath, objectBPath string) []string
- func ParseAndValidate(r *http.Request, spec interface{}) error
- func ParseReqBodyToSpec(r *http.Request, spec interface{}) error
- func SpecFromMap(data map[string]string, spec interface{}) error
- func SpecFromMapInterface(data map[string]interface{}, spec interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidInput = errors.New("input must be a struct pointer")
ErrInvalidInput indicates invalid input to parse the json string into
Functions ¶
func Diff ¶
Diff compares 2 JSON strings and returns the changed/added/removed top level json objects
func JsonToSpec ¶
JsonToSpec transforms the byte array to the given struct
func ObjectDiff ¶
ObjectDiff compares specified object in 2 json strings returns the top level differences between the found objects
func ParseAndValidate ¶
ParseAndValidate parses the HTTP request body into struct and Validate based on struct tags
func ParseReqBodyToSpec ¶
ParseReqBodyToSpec parses HTTP request body into the given struct
func SpecFromMap ¶
SpecFromMap parses the given map into the spec
func SpecFromMapInterface ¶
SpecFromMap parses the given map into the spec
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.