Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

marshal opts #982

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open

marshal opts #982

wants to merge 1 commit into from

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.

@@ -48,7 +47,7 @@ type obsoleteUnmarshaler interface {
// 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants