jsonutils

package
v0.0.0-...-fa0a123 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package jsonutils offers additional JSON processing helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareRawJSON

func CompareRawJSON(expected, actual []byte) error

CompareRawJSON verifies that both given json raw messages match whilst ignoring the key order and any whitespace differences. The parameters can be of type json.RawMessage as this is an alias for []byte. Any difference will be returned as error.

func ValidateRemarshal

func ValidateRemarshal(source []byte, object any, options ...cmp.Option) error

ValidateRemarshal verifies that the json source and the given object match when being marshalled. This allows to detect changes in struct fields that are returned from APIs and not handled in the struct type. Any difference will be returned as error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL