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
{{ message }}
Repository navigation
Preserve json keys order while marshalling in Go #56
The problem is that while this type can be opinionated about how it's encoded it's not safe to assume the same is true for decoding. For example, multiple JSON formats would be acceptable for decoding and it's not sensible to settle on one.
That is why you should create your own marshaller for the symmetrical encode/decode format you desire. I'm open to accepting these new types into the library, but with some discussion first.
Activity
elliotchance commentedon Jul 9, 2025
This has been raised before: #12
The problem is that while this type can be opinionated about how it's encoded it's not safe to assume the same is true for decoding. For example, multiple JSON formats would be acceptable for decoding and it's not sensible to settle on one.
That is why you should create your own marshaller for the symmetrical encode/decode format you desire. I'm open to accepting these new types into the library, but with some discussion first.