unmappeddatamarshaller

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleUnmappedDataPropertyMarshalling

func HandleUnmappedDataPropertyMarshalling(b []byte) (bytes []byte, err error)

HandleUnmappedDataPropertyMarshalling expects the bytes of a marshalled struct. If the marshalled struct contains 'unmapped' fields meaning ones that had no corresponding, strong-typed field when initially unmarshalled, those fields will be extracted again. The extracted field from the maps containing the unmapped data will be placed on the top level of the marshalled struct.

func UnmarshallWithUnmappedData

func UnmarshallWithUnmappedData[T any](targetStruct *T, unmappedDataInTargetStruct *ExtensionData, bytes []byte) (err error)

UnmarshallWithUnmappedData will unmarshal a given type by mapping all strong-typed fields to the 'targetStruct'. All other fields will be preserved in the 'unmappedDataInTargetStruct' dictionary.

Types

type ExtensionData

type ExtensionData map[string]any

func (ExtensionData) CompareTo

func (ed ExtensionData) CompareTo(otherEd ExtensionData) bool

Jump to

Keyboard shortcuts

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