Skip to content

Commit f5b955b

Browse files
committed
feat(apijson): move changes to new apijsoncustom package
Use `apijsoncustom` in `cloudflare_ruleset` only for now. This unblocks bug fixes while we review the changes to be merged upstream.
1 parent 71538e5 commit f5b955b

File tree

11 files changed

+5435
-1053
lines changed

11 files changed

+5435
-1053
lines changed

internal/apijson/decoder.go

Lines changed: 86 additions & 212 deletions
Large diffs are not rendered by default.

internal/apijson/json_test.go

Lines changed: 2 additions & 770 deletions
Large diffs are not rendered by default.

internal/apijson/tag.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ type parsedStructTag struct {
3131
// otherwise just use the UseStateForUnknown plan modifier
3232
// NOTE #2: won't work if update behavior is 'patch'
3333
encodeStateValueWhenPlanUnknown bool
34-
// decodeZeroValueWhenNull indicates whether null and omitted values should
35-
// be decoded as the zero value of the field type instead of leaving the
36-
// field unset.
37-
decodeZeroValueWhenNull bool
3834
}
3935

4036
func parseJSONStructTag(field reflect.StructField) (tag parsedStructTag, ok bool) {
@@ -67,8 +63,6 @@ func parseJSONStructTag(field reflect.StructField) (tag parsedStructTag, ok bool
6763
tag.noRefresh = true
6864
case "encode_state_for_unknown":
6965
tag.encodeStateValueWhenPlanUnknown = true
70-
case "decode_null_to_zero":
71-
tag.decodeZeroValueWhenNull = true
7266
case "force_encode":
7367
tag.forceEncode = true
7468
}

0 commit comments

Comments
 (0)