Skip to content

encoding/json/v2: document MarshalJSONTo (etc) method use recommendations #76712

@prattmic

Description

@prattmic

For #74322, we decided that that proposal could be decided after the main encoding/json/v2 proposal is complete provided that the various MarshalJSONTo, etc methods document:

  1. Callers should prefer to use encoding/json/v2.Marshal rather than calling the methods directly, as Marshal will handle the special cases internally.
  2. If callers do call MarshalJSONTo directly, there is a set of sentinel errors the method may return which they are responsible for handling.

I'm filing this issue to track adding this documentation, as #74322 is now marked post-proposal.

cc @dsnet @neild @ChrisHines

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    Status

    Needs review

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions