[website] WIP: _content/doc/jsonv2-migration: encoding/json/v2 migration guide

9 views
Skip to first unread message

Michael Pratt (Gerrit)

unread,
Jul 29, 2026, 3:36:41 PM (13 days ago) Jul 29
to Michael Pratt, goph...@pubsubhelper.golang.org, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
Attention needed from Chris Hines, Damien Neil and Joseph Tsai

Michael Pratt voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Chris Hines
  • Damien Neil
  • Joseph Tsai
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: website
Gerrit-Branch: master
Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
Gerrit-Change-Number: 806921
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-CC: Austin Clements <aus...@google.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Attention: Chris Hines <chris....@gmail.com>
Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
Gerrit-Comment-Date: Wed, 29 Jul 2026 19:36:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Chris Hines (Gerrit)

unread,
Jul 29, 2026, 7:10:14 PM (13 days ago) Jul 29
to Michael Pratt, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

Chris Hines added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Chris Hines . resolved

It's a good start.

I refrained from commenting on a few typos I saw until the overall structure is more settled.

I'd like to see more discussion of migration strategies more in the middle of the two extremes of one option at a time and full switch.

I doubt many projects have comprehensive enough tests to find all the differences. Can we suggest any techniques to enhance tests or use fuzzing or jsonsplit to proactively search for issues?

What about migrating Unmarshal code? That probably deserves some discussion as well.

Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
  • Joseph Tsai
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: website
Gerrit-Branch: master
Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
Gerrit-Change-Number: 806921
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-CC: Austin Clements <aus...@google.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
Gerrit-Comment-Date: Wed, 29 Jul 2026 23:10:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Aug 3, 2026, 1:17:55 PM (9 days ago) Aug 3
to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

Michael Pratt uploaded new patchset

Michael Pratt uploaded patch set #3 to this change.
Following approvals got outdated and were removed:
Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
  • Joseph Tsai
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: website
Gerrit-Branch: master
Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
Gerrit-Change-Number: 806921
Gerrit-PatchSet: 3
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Aug 3, 2026, 1:18:09 PM (9 days ago) Aug 3
to Michael Pratt, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
Attention needed from Chris Hines, Damien Neil and Joseph Tsai

Michael Pratt voted and added 1 comment

Votes added by Michael Pratt

Commit-Queue+1

1 comment

Patchset-level comments
Chris Hines . resolved

It's a good start.

I refrained from commenting on a few typos I saw until the overall structure is more settled.

I'd like to see more discussion of migration strategies more in the middle of the two extremes of one option at a time and full switch.

I doubt many projects have comprehensive enough tests to find all the differences. Can we suggest any techniques to enhance tests or use fuzzing or jsonsplit to proactively search for issues?

What about migrating Unmarshal code? That probably deserves some discussion as well.

Michael Pratt

It's a good start.

I refrained from commenting on a few typos I saw until the overall structure is more settled.

I'd like to see more discussion of migration strategies more in the middle of the two extremes of one option at a time and full switch.

Thanks for the feedback, I also found the style a bit too informal and meandering.

I've reworked things to be a bit more up front about different approach "all-at-once", "option-by-option" (the two extremes), and jsonsplit.


I doubt many projects have comprehensive enough tests to find all the differences. Can we suggest any techniques to enhance tests or use fuzzing or jsonsplit to proactively search for issues?

What about migrating Unmarshal code? That probably deserves some discussion as well.

I've added a note that the same process applies to both Marshal and Unmarshal, but perhaps it is too subtle.

Open in Gerrit

Related details

Attention is currently required from:
  • Chris Hines
  • Damien Neil
  • Joseph Tsai
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: website
Gerrit-Branch: master
Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
Gerrit-Change-Number: 806921
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-CC: Austin Clements <aus...@google.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Attention: Chris Hines <chris....@gmail.com>
Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
Gerrit-Comment-Date: Mon, 03 Aug 2026 17:18:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Chris Hines <chris....@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Jonathan Amsterdam (Gerrit)

unread,
Aug 4, 2026, 4:20:26 PM (7 days ago) Aug 4
to Michael Pratt, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
Attention needed from Chris Hines, Damien Neil, Joseph Tsai and Michael Pratt

Jonathan Amsterdam added 15 comments

File _content/doc/jsonv2-migration.md
Line 11, Patchset 3 (Latest):First things first: you don't have to!
Jonathan Amsterdam . unresolved

Start stronger. After "to!": "The encoding/json package will never go away."
Then you can drop the "deprecation...deadline" part, but keep the "indefinitely" for emphasis.

Line 16, Patchset 3 (Latest):For example, this means that if a type implements custom marshaling behavior with [`encoding/json/v2.MarshalerTo`](/pkg/encoding/json/v2#MarshalerTo), the callers marshaling this type through [`encoding/json.Marshal`](/pkg/encoding/json#Marshal) will still go through the custom marshaler.
Jonathan Amsterdam . unresolved

delete

Line 19, Patchset 3 (Latest):Though you are not required to migrate, there are several motivations for a migration:
Jonathan Amsterdam . unresolved

several good reasons to do so

Line 21, Patchset 3 (Latest):First, the new API contains a variety of changes to make it easier to work with.
Jonathan Amsterdam . unresolved

is easier to use

Line 33, Patchset 3 (Latest):These changes are designed to make `encoding/json/v2` more interoperable with the wider JSON ecosystem and less surprising or error-prone to use.
Jonathan Amsterdam . unresolved

and

Line 35, Patchset 3 (Latest):That said, these behavior changes are not backwards compatible; some applications may depend on the v1 behavior.
Jonathan Amsterdam . unresolved

no new paragraph
"But they"

Line 78, Patchset 3 (Latest):If we trivially this program to `encoding/json/v2` by changing the import, the program still compiles.
Jonathan Amsterdam . unresolved

modify?

Line 86, Patchset 3 (Latest):If this were a new program, using an empty array is likely a nice improvement, but in an existing application downstream consumers of this output may be depending on the presence of `null`.
Jonathan Amsterdam . unresolved

, so this change may break them

Line 131, Patchset 3 (Latest):Depending on the type of application and it's risk tolerance, there are several different ways to approach a v2 migration:
Jonathan Amsterdam . unresolved

its

Line 143, Patchset 3 (Latest):The the source of the problem is not clear, you may want to use one of the approaches below to help troubleshoot.
Jonathan Amsterdam . unresolved

If

Line 158, Patchset 3 (Latest):This provides a building block to perform a slower migration rather than changing all behavior at once.
Jonathan Amsterdam . unresolved

path? More like a sequence than collection of blocks??

Line 160, Patchset 3 (Latest):Alternatively, when troubleshooting these options provide a way to bisect down to the exact breaking behavior change.
Jonathan Amsterdam . unresolved

You're abstracting a fairly complex design choice into a quick sentence. How on earth do I make my program bisect-able like that? Maybe an idea or two here would help.

Having read the jsonsplit section, I think this advice is unnecessary. Just use jsonsplit!

Line 172, Patchset 3 (Latest):If the output differs, it will report a difference, but still return the v1 value to the caller.
Jonathan Amsterdam . unresolved

It will report any differences, but..

Line 174, Patchset 3 (Latest):This provides reporting of differences from a production service without impacting user-visible behavior.
Jonathan Amsterdam . unresolved

This allows a production service to report differences without changing its behavior.

Line 228, Patchset 3 (Latest):We can do a smooth production migration something like:
Jonathan Amsterdam . unresolved

We can migrate our production service smoothly using a procedure like the following:

Open in Gerrit

Related details

Attention is currently required from:
  • Chris Hines
  • Damien Neil
  • Joseph Tsai
  • Michael Pratt
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: website
    Gerrit-Branch: master
    Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
    Gerrit-Change-Number: 806921
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-CC: Austin Clements <aus...@google.com>
    Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
    Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
    Gerrit-CC: Jonathan Amsterdam <j...@google.com>
    Gerrit-Attention: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Damien Neil <dn...@google.com>
    Gerrit-Attention: Chris Hines <chris....@gmail.com>
    Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
    Gerrit-Comment-Date: Tue, 04 Aug 2026 20:20:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Michael Pratt (Gerrit)

    unread,
    Aug 4, 2026, 4:48:56 PM (7 days ago) Aug 4
    to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Chris Hines, Damien Neil, Joseph Tsai and Michael Pratt

    Michael Pratt uploaded new patchset

    Michael Pratt uploaded patch set #4 to this change.
    Following approvals got outdated and were removed:

    Related details

    Attention is currently required from:
    • Chris Hines
    • Damien Neil
    • Joseph Tsai
    • Michael Pratt
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: website
      Gerrit-Branch: master
      Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
      Gerrit-Change-Number: 806921
      Gerrit-PatchSet: 4
      unsatisfied_requirement
      open
      diffy

      Michael Pratt (Gerrit)

      unread,
      Aug 4, 2026, 4:49:19 PM (7 days ago) Aug 4
      to Michael Pratt, goph...@pubsubhelper.golang.org, Jonathan Amsterdam, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
      Attention needed from Chris Hines, Damien Neil, Jonathan Amsterdam and Joseph Tsai

      Michael Pratt added 15 comments

      File _content/doc/jsonv2-migration.md
      Line 11, Patchset 3:First things first: you don't have to!
      Jonathan Amsterdam . resolved

      Start stronger. After "to!": "The encoding/json package will never go away."
      Then you can drop the "deprecation...deadline" part, but keep the "indefinitely" for emphasis.

      Michael Pratt

      Done

      Line 16, Patchset 3:For example, this means that if a type implements custom marshaling behavior with [`encoding/json/v2.MarshalerTo`](/pkg/encoding/json/v2#MarshalerTo), the callers marshaling this type through [`encoding/json.Marshal`](/pkg/encoding/json#Marshal) will still go through the custom marshaler.
      Jonathan Amsterdam . resolved

      delete

      Michael Pratt

      Done

      Line 19, Patchset 3:Though you are not required to migrate, there are several motivations for a migration:
      Jonathan Amsterdam . resolved

      several good reasons to do so

      Michael Pratt

      Done

      Line 21, Patchset 3:First, the new API contains a variety of changes to make it easier to work with.
      Jonathan Amsterdam . resolved

      is easier to use

      Michael Pratt

      Done

      Line 33, Patchset 3:These changes are designed to make `encoding/json/v2` more interoperable with the wider JSON ecosystem and less surprising or error-prone to use.
      Jonathan Amsterdam . resolved

      and

      Michael Pratt

      Done

      Line 35, Patchset 3:That said, these behavior changes are not backwards compatible; some applications may depend on the v1 behavior.
      Jonathan Amsterdam . resolved

      no new paragraph
      "But they"

      Michael Pratt

      Done

      Line 78, Patchset 3:If we trivially this program to `encoding/json/v2` by changing the import, the program still compiles.
      Jonathan Amsterdam . resolved

      modify?

      Michael Pratt

      Done

      Line 86, Patchset 3:If this were a new program, using an empty array is likely a nice improvement, but in an existing application downstream consumers of this output may be depending on the presence of `null`.
      Jonathan Amsterdam . resolved

      , so this change may break them

      Michael Pratt

      Done

      Line 131, Patchset 3:Depending on the type of application and it's risk tolerance, there are several different ways to approach a v2 migration:
      Jonathan Amsterdam . resolved

      its

      Michael Pratt

      Done

      Line 143, Patchset 3:The the source of the problem is not clear, you may want to use one of the approaches below to help troubleshoot.
      Jonathan Amsterdam . resolved

      If

      Michael Pratt

      Done

      Line 158, Patchset 3:This provides a building block to perform a slower migration rather than changing all behavior at once.
      Jonathan Amsterdam . resolved

      path? More like a sequence than collection of blocks??

      Michael Pratt

      Done

      Line 160, Patchset 3:Alternatively, when troubleshooting these options provide a way to bisect down to the exact breaking behavior change.
      Jonathan Amsterdam . resolved

      You're abstracting a fairly complex design choice into a quick sentence. How on earth do I make my program bisect-able like that? Maybe an idea or two here would help.

      Having read the jsonsplit section, I think this advice is unnecessary. Just use jsonsplit!

      Michael Pratt

      I've added a mention of jsonsplit here.

      Line 172, Patchset 3:If the output differs, it will report a difference, but still return the v1 value to the caller.
      Jonathan Amsterdam . resolved

      It will report any differences, but..

      Michael Pratt

      Done

      Line 174, Patchset 3:This provides reporting of differences from a production service without impacting user-visible behavior.
      Jonathan Amsterdam . resolved

      This allows a production service to report differences without changing its behavior.

      Michael Pratt

      Done

      Line 228, Patchset 3:We can do a smooth production migration something like:
      Jonathan Amsterdam . resolved

      We can migrate our production service smoothly using a procedure like the following:

      Michael Pratt

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Hines
      • Damien Neil
      • Jonathan Amsterdam
      • Joseph Tsai
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 4
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-CC: Jonathan Amsterdam <j...@google.com>
        Gerrit-Attention: Damien Neil <dn...@google.com>
        Gerrit-Attention: Jonathan Amsterdam <j...@google.com>
        Gerrit-Attention: Chris Hines <chris....@gmail.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Tue, 04 Aug 2026 20:49:10 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Jonathan Amsterdam <j...@google.com>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Jonathan Amsterdam (Gerrit)

        unread,
        Aug 5, 2026, 12:33:00 PM (7 days ago) Aug 5
        to Michael Pratt, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
        Attention needed from Chris Hines, Damien Neil, Joseph Tsai and Michael Pratt

        Jonathan Amsterdam voted Code-Review+2

        Code-Review+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chris Hines
        • Damien Neil
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 4
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Damien Neil <dn...@google.com>
        Gerrit-Attention: Chris Hines <chris....@gmail.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Wed, 05 Aug 2026 16:32:54 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Chris Hines (Gerrit)

        unread,
        Aug 7, 2026, 3:38:39 AM (5 days ago) Aug 7
        to Michael Pratt, goph...@pubsubhelper.golang.org, Jonathan Amsterdam, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
        Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

        Chris Hines added 4 comments

        Patchset-level comments
        File-level comment, Patchset 4 (Latest):
        Chris Hines . resolved

        I like the changes since my last review. I saw a few things while reading the latest version.

        File _content/doc/jsonv2-migration.md
        Line 7, Patchset 4 (Latest):This guide describes why you may want to migration from the v1 to v2 package, and the mechanics of doing so safely.
        Chris Hines . unresolved

        migrate

        Line 174, Patchset 4 (Latest):By setting [`AutoDetectOptions`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#Codec), `jsonsplit` will even automatically determine which specific options cause the difference.
        Chris Hines . unresolved

        Consider mentioning that AutoDetectOptions is slow (since we are talking about using it in production services in this section) and that jsonsplit provides ways to only perform the extra work on some marshal calls.

        Line 229, Patchset 4 (Latest):1. Switch callsites to `jsonsplit`, set [`CallBothButReturnV1`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode), [`AutoDetectOptions`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) (optional), and wire up your preferred monitoring approach to [`ReportDifference`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) (such as logging or published metrics).

        2. Monitor your production environment for reported differences.

        3. Encode differences.

        Where `jsonsplit` reports differences, adjust the options or types to ensure identical output.

        For example, in the example above, pass the `json.FormatNilSliceAsNull(true)` option.
        In other cases, v2 may report a problem that is straightforward to fix.
        For example, applying the "string" JSON struct field tag to an invalid type (such as a struct) is ignored in v1, but reports an error in v2.
        While [`ReportErrorsWithLegacySemantics`](/pkg/encoding/json#ReportErrorsWithLegacySemantics) would suppress the error, it makes more sense to drop the "string" tag.
        It isn't doing anything anyway.

        Note that a difference in output does not necessarily mean that downstream behavior is broken, but that there is an opportunity for breakage.
        We adjust options now so we can complete the vast majority of the migration without stopping to evaluate subtle output changes, but after switching to v2, you should revisit these locations to determine if you can migrate to the new behavior.

        4. Switch to v2.

        Once your production environment stops reporting new differences, you can migrate to v2 behavior by setting [`OnlyCallV2`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) or [`CallBothButReturnV2`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) to keep checking for differences.

        5. Clean up.
        Chris Hines . unresolved

        This numbered sequence of steps is nice, but it echos the opening paragraphs of this section too much. The beginning of the jsonsplit section has paragraphs starting with "First ...", and "Next ..." which have a sequence of steps narrative structure. Consider rewording the beginning of the section to be less list like and simply describe jsonsplit's capabilities. That leaves the job of describing the migration sequence to this numbered list without it feeling like deja vu when reading it.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Damien Neil
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 4
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Damien Neil <dn...@google.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Fri, 07 Aug 2026 07:38:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michael Pratt (Gerrit)

        unread,
        Aug 7, 2026, 12:54:44 PM (5 days ago) Aug 7
        to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

        Michael Pratt uploaded new patchset

        Michael Pratt uploaded patch set #5 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Damien Neil
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 5
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michael Pratt (Gerrit)

        unread,
        Aug 7, 2026, 12:55:04 PM (5 days ago) Aug 7
        to Michael Pratt, goph...@pubsubhelper.golang.org, Jonathan Amsterdam, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Chris Hines, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
        Attention needed from Chris Hines, Damien Neil and Joseph Tsai

        Michael Pratt added 3 comments

        File _content/doc/jsonv2-migration.md
        Line 7, Patchset 4:This guide describes why you may want to migration from the v1 to v2 package, and the mechanics of doing so safely.
        Chris Hines . resolved

        migrate

        Michael Pratt

        Done

        Line 174, Patchset 4:By setting [`AutoDetectOptions`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#Codec), `jsonsplit` will even automatically determine which specific options cause the difference.
        Chris Hines . resolved

        Consider mentioning that AutoDetectOptions is slow (since we are talking about using it in production services in this section) and that jsonsplit provides ways to only perform the extra work on some marshal calls.

        Michael Pratt

        Done

        Line 229, Patchset 4:1. Switch callsites to `jsonsplit`, set [`CallBothButReturnV1`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode), [`AutoDetectOptions`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) (optional), and wire up your preferred monitoring approach to [`ReportDifference`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) (such as logging or published metrics).


        2. Monitor your production environment for reported differences.

        3. Encode differences.

        Where `jsonsplit` reports differences, adjust the options or types to ensure identical output.

        For example, in the example above, pass the `json.FormatNilSliceAsNull(true)` option.
        In other cases, v2 may report a problem that is straightforward to fix.
        For example, applying the "string" JSON struct field tag to an invalid type (such as a struct) is ignored in v1, but reports an error in v2.
        While [`ReportErrorsWithLegacySemantics`](/pkg/encoding/json#ReportErrorsWithLegacySemantics) would suppress the error, it makes more sense to drop the "string" tag.
        It isn't doing anything anyway.

        Note that a difference in output does not necessarily mean that downstream behavior is broken, but that there is an opportunity for breakage.
        We adjust options now so we can complete the vast majority of the migration without stopping to evaluate subtle output changes, but after switching to v2, you should revisit these locations to determine if you can migrate to the new behavior.

        4. Switch to v2.

        Once your production environment stops reporting new differences, you can migrate to v2 behavior by setting [`OnlyCallV2`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) or [`CallBothButReturnV2`](https://pkg.go.dev/github.com/go-json-experiment/jsonsplit#CallMode) to keep checking for differences.

        5. Clean up.
        Chris Hines . resolved

        This numbered sequence of steps is nice, but it echos the opening paragraphs of this section too much. The beginning of the jsonsplit section has paragraphs starting with "First ...", and "Next ..." which have a sequence of steps narrative structure. Consider rewording the beginning of the section to be less list like and simply describe jsonsplit's capabilities. That leaves the job of describing the migration sequence to this numbered list without it feeling like deja vu when reading it.

        Michael Pratt

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chris Hines
        • Damien Neil
        • Joseph Tsai
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 5
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-Attention: Damien Neil <dn...@google.com>
        Gerrit-Attention: Chris Hines <chris....@gmail.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Fri, 07 Aug 2026 16:54:51 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Chris Hines <chris....@gmail.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Chris Hines (Gerrit)

        unread,
        Aug 7, 2026, 10:56:01 PM (4 days ago) Aug 7
        to Michael Pratt, goph...@pubsubhelper.golang.org, Jonathan Amsterdam, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Damien Neil, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
        Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

        Chris Hines voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Damien Neil
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 5
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Damien Neil <dn...@google.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Sat, 08 Aug 2026 02:55:57 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michael Pratt (Gerrit)

        unread,
        Aug 11, 2026, 4:19:01 PM (11 hours ago) Aug 11
        to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Damien Neil, Joseph Tsai and Michael Pratt

        Michael Pratt uploaded new patchset

        Michael Pratt uploaded patch set #6 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Damien Neil
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 6
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Damien Neil (Gerrit)

        unread,
        Aug 11, 2026, 7:51:21 PM (8 hours ago) Aug 11
        to Michael Pratt, goph...@pubsubhelper.golang.org, Chris Hines, Jonathan Amsterdam, golang...@luci-project-accounts.iam.gserviceaccount.com, Joseph Tsai, Austin Clements, Daniel Martí, Johan Brandhorst-Satzkorn, golang-co...@googlegroups.com
        Attention needed from Joseph Tsai and Michael Pratt

        Damien Neil voted Code-Review+2

        Code-Review+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joseph Tsai
        • Michael Pratt
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: website
        Gerrit-Branch: master
        Gerrit-Change-Id: Ibaded378e760d009b770a9158157d44f6a6a6964
        Gerrit-Change-Number: 806921
        Gerrit-PatchSet: 6
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Damien Neil <dn...@google.com>
        Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
        Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Austin Clements <aus...@google.com>
        Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
        Gerrit-CC: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Joseph Tsai <joe...@digital-static.net>
        Gerrit-Comment-Date: Tue, 11 Aug 2026 23:51:09 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages