@@ -27,45 +27,28 @@ func NewDecoder(opts ...option[Decoder]) *Decoder {
2727 return d
2828}
2929
30- // WithAliasTagDecoderOpt changes the tag used to locate custom field aliases.
31- // The default tag is "schema".
30+ // See [Decoder.SetAliasTag] for more information.
3231func WithAliasTagDecoderOpt (tag string ) option [Decoder ] {
3332 return func (d * Decoder ) {
3433 d .SetAliasTag (tag )
3534 }
3635}
3736
38- // WithZeroEmptyDecoderOpt controls the behaviour when the decoder encounters empty values.
39- // in a map.
40- // If z is true and a key in the map has the empty string as a value
41- // then the corresponding struct field is set to the zero value.
42- // If z is false then empty strings are ignored.
43- //
44- // The default value is false, that is empty values do not change
45- // the value of the struct field.
37+ // See [Decoder.ZeroEmpty] for more information.
4638func WithZeroEmptyDecoderOpt (z bool ) option [Decoder ] {
4739 return func (d * Decoder ) {
4840 d .ZeroEmpty (z )
4941 }
5042}
5143
52- // WithIgnoreUnknownKeysDecoderOpt controls the behaviour when the decoder
53- // encounters unknown keys in the map.
54- // If i is true and an unknown field is encountered, it is ignored. This is
55- // similar to how unknown keys are handled by encoding/json.
56- // If i is false then Decode will return an error. Note that any valid keys
57- // will still be decoded in to the target struct.
58- //
59- // To preserve backwards compatibility, the default value is false.
44+ // See [Decoder.IgnoreUnknownKeys] for more information.
6045func WithIgnoreUnknownKeysDecoderOpt (i bool ) option [Decoder ] {
6146 return func (d * Decoder ) {
6247 d .IgnoreUnknownKeys (i )
6348 }
6449}
6550
66- // WithMaxSizeDecoderOpt limits the size of slices for URL nested arrays or object arrays.
67- // Choose MaxSize carefully; large values may create many zero-value slice elements.
68- // Example: "items.100000=apple" would create a slice with 100,000 empty strings.
51+ // See [Decoder.MaxSize] for more information.
6952func WithMaxSizeDecoderOpt (size int ) option [Decoder ] {
7053 return func (d * Decoder ) {
7154 d .MaxSize (size )
0 commit comments