Skip to content

Commit 07b200b

Browse files
docs: clarify requirements for json:",omitzero" fields in options structs (#1018)
1 parent bf32ea6 commit 07b200b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
## Conventions And Gotchas
3636
- Optional fields in create or update options structs must use `json:",omitzero"`.
37-
- Optional fields in create or update options structs must be pointer types so explicit zero values can be serialized when needed.
37+
- Every field with a `json:",omitzero"` tag MUST be a nil-able type (pointers, slices, maps, interfaces, etc.) so omitted vs explicit zero values can be distinguished and serialized correctly when needed. Non-nil-able types (plain `string`, `int`, `bool`, structs, etc.) must not use `omitzero`.
3838
- List APIs mutate the supplied `*ListOptions` with `Page`, `Pages`, and `Results`; do not reuse one `ListOptions` across list calls.
3939
- Use `formatAPIPath` for endpoint paths with user-provided string path segments so path escaping matches the client helpers.
4040
- CI enforces PR titles like `TPT-1234: Description` unless labels exempt the PR (`dependencies`, `hotfix`, `community-contribution`, `ignore-for-release`).

0 commit comments

Comments
 (0)