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

Feature: format as json.Options #52

Closed
morlay opened this issue Oct 10, 2024 · 3 comments
Closed

Feature: format as json.Options #52

morlay opened this issue Oct 10, 2024 · 3 comments

Comments

@morlay
Copy link

morlay commented Oct 10, 2024

may marshal or unmarshal value directly, not just in struct

json.Marshal([]byte("11111"), json.Format("hex"))
@dsnet
Copy link
Collaborator

dsnet commented Oct 18, 2024

We considered making format a first class option, but there are gnarly questions about whether it only applies to the next top-level value or recursively across the entire tree.

@morlay
Copy link
Author

morlay commented Oct 19, 2024

We considered making format a first class option, but there are gnarly questions about whether it only applies to the next top-level value or recursively across the entire tree.

no idea.
in fact, i prefer to use encoding.Text*arshaler instead.

I'm implementing json unmarshal with custom validation base on go-json-experiment.
here is no way to pass format option in my tree walk.
https://github.com/octohelm/courier/blob/main/pkg/validator/internal/value.go#L560

example: https://github.com/octohelm/courier/blob/main/pkg/validator/arshal_test.go

@dsnet
Copy link
Collaborator

dsnet commented Nov 20, 2024

Closing as duplicate of #46.

@dsnet dsnet closed this as completed Nov 20, 2024
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

No branches or pull requests

2 participants