Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewComparator ¶
func NewComparator() *Builder
NewComparator is the builder initiator. Always use the builder to create a Comparator as this will set the default options.
func (*Builder) Build ¶
func (builder *Builder) Build() *Comparator
func (*Builder) StrictObjectCheck ¶
StrictObjectCheck determines if the Comparator will do a strict check on object fields. If set to 'true', the following checks will be done: - actual JSON has the same number of fields - actual JSON has extra unexpected fields
Default is 'true'.
type Comparator ¶
type Comparator struct {
// contains filtered or unexported fields
}
Comparator used for comparing JSON structures. It returns detailed errors about how the compared structures do not match. The errors may also contain JSON paths that point to the fields discovered.
Always create a comparator using the NewComparator builder.
The comparator does not fail fast and goes over the entire structure for validation. It is goroutine safe.