Skip to content

feat(optional): support omitempty, omitzero and pointer fields as optional (v3 too)#2156

Open
Hoffs wants to merge 4 commits intoswaggo:v2from
Hoffs:v2
Open

feat(optional): support omitempty, omitzero and pointer fields as optional (v3 too)#2156
Hoffs wants to merge 4 commits intoswaggo:v2from
Hoffs:v2

Conversation

@Hoffs
Copy link
Copy Markdown

@Hoffs Hoffs commented Mar 25, 2026

Describe the PR
cherry-picked omitempty support from master branch and added omitzero support as well as pointer type to be treated as optional

Additional context
v2 is out of sync with master by a large margin

andyatmiami and others added 4 commits March 25, 2026 10:14
Enhance field parser to recognize 'omitempty' in JSON tags, updating IsRequired logic and adding corresponding test cases. Update README to document the new behavior.

Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
@Hoffs Hoffs changed the title feat(optional): support omitempty, omitzero and pointer fields as optional feat(optional): support omitempty, omitzero and pointer fields as optional (v3 too) Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants