Skip to content

[Feature Request] Have a symmetric MarshalJSON and UnmarshalJSON for all API types  #186

@spacedragon

Description

@spacedragon

🚀 Feature Request Description

Types should have symmetric MarshalJSON & UnmarshalJSON

Motivation

The following code should work, but it doesn't because the Transaction doesn't have a MarshalJSON which produce the JSON that can be Unmarshal

tx1 := ...  
jsonBytes, _ = json.Marshal(tx1)

err := json.Unmarshal(jsonBytes, &tx2)  // may err

Pitch

Describe the solution you would like
The MarshalJSON should be defined too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions