Skip to content

Add the dive tag for slice, array, and map elements - #114

Merged
leocavalcante merged 1 commit into
mainfrom
feat/dive-tag
Sep 29, 2026
Merged

leocavalcante merged 1 commit into
mainfrom
feat/dive-tag

Conversation

@leocavalcante

Copy link
Copy Markdown
Member

Summary

  • dive applies the tags after it to each slice element, array element, or map value. Tags before it stay on the collection.
  • A struct element uses the validator the generator already emits. []*Address with required,dive,required checks a non-empty slice, non-nil pointers, and Address fields. A slice of structs with only required does not walk the elements.
  • Map values are validated. Map keys are not. keys and endkeys stay unsupported. Nested arrays, pointer mixes the type encoding cannot tell apart, and in/nin on a slice of pointers are rejected.

Fixes #7

Test plan

  • go test on parser, analyzer, common, and codegenerator
  • make unittests
  • make endtoendtests covers a slice of structs, a map value, a slice that does not dive, and []*Address
  • CI build is green

Tags after dive apply to each slice, array, or map value, including nested structs the generator already knows. keys and endkeys stay unsupported.
@leocavalcante
leocavalcante merged commit f77ce23 into main Sep 29, 2026
4 checks passed
@leocavalcante
leocavalcante deleted the feat/dive-tag branch September 29, 2026 21:25
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.

Feat: implement dive Tag

1 participant