Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Conversation

aathan
Copy link

@aathan aathan commented Aug 9, 2023

Allows passing of options to marshal/encode ... implements one option so far which is to not lowercase all struct keys.

@aathan
Copy link
Author

aathan commented Aug 9, 2023

See #981 for combined PR.

// If an error is returned by MarshalYAML, the marshaling procedure stops
// and returns with the provided error.
type Marshaler interface {
MarshalYAML() (interface{}, error)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a major breaking change.

Copy link
Author

@aathan aathan Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no longer working on the downstream project and do not have time to make improvements/changes to the project. I'm sure there is a way to integrate these ideas that "breaks" the existing API less, while using most of the implementation I've already provided. YAML marshaling is much more likely to need "modifiers" (options) than typical simple json marshaling, so I think you should consider adding such features. E.g. perhaps the marshaler could look for an alternative more capable interface (Marshaler2) and use it if it's available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants