You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are cases where objects could be marshaled in different ways,.especially those with custom marshalers.
Example: i've got an recursive dictionary with extra features like defaults and variable substitution. Depending on the actual use case, marshaling could be done eg w/ or w/o merging defaults, or w/ or w/o resolving variables.
Adding new frontend functions with extra parameters (eg. yaml.MarshalExt(...)) simple. But the Marshaler interface has no means for passing extra parameters down to the individual object.
Proposal: extended Marshaler interface, eg.
type MarshalerExr interface {
MarshalYAMLExt(args map[string] string) (interface{}, error)
}
Of course there yet needs to be some convention on naming these args keys, in order to prevent clashes between different object types.
The text was updated successfully, but these errors were encountered:
There are cases where objects could be marshaled in different ways,.especially those with custom marshalers.
Example: i've got an recursive dictionary with extra features like defaults and variable substitution. Depending on the actual use case, marshaling could be done eg w/ or w/o merging defaults, or w/ or w/o resolving variables.
Adding new frontend functions with extra parameters (eg. yaml.MarshalExt(...)) simple. But the Marshaler interface has no means for passing extra parameters down to the individual object.
Proposal: extended Marshaler interface, eg.
type MarshalerExr interface {
MarshalYAMLExt(args map[string] string) (interface{}, error)
}
Of course there yet needs to be some convention on naming these args keys, in order to prevent clashes between different object types.
The text was updated successfully, but these errors were encountered: