encoding/json: document and test composing multiple field tag options #47498
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
It seems like
encoding/json
allows using multiple field tag options at once, such as,omitempty
and,string
:https://play.golang.org/p/382n_YPRJ_4
This does not appear to be documented or tested in the json package. We should probably do that.
It's also worth thinking if there's any combination of options that would interact in confusing ways. In that case, the docs might need to document what their combined behavior would be, e.g. in what order the options take effect.
One particular example is
,omitempty
and,string
, which is easy, given that the only wayomitempty
makes sense in that combination is if it applies beforestring
when encoding.cc @dsnet
The text was updated successfully, but these errors were encountered: