Skip to content

feat(derive): add explicit nested field option#21

Draft
bengreenier wants to merge 4 commits intomainfrom
cursor/nested-partials-support-bf38
Draft

feat(derive): add explicit nested field option#21
bengreenier wants to merge 4 commits intomainfrom
cursor/nested-partials-support-bf38

Conversation

@bengreenier
Copy link
Copy Markdown
Owner

@bengreenier bengreenier commented Mar 25, 2026

Summary

  • add an explicit field option: #[partially(nested)]
  • for nested fields, generate <FieldType as Partial>::Item in the partial struct
  • for nested fields, generated apply_some recurses via Partial::apply_some
  • keep nested behavior opt-in (no heuristic auto-detection)
  • preserve precedence/validation with other field options (omit, transparent, as_type)
  • add tests/docs/changelog updates for explicit nested behavior
  • add regression coverage that non-annotated fields stay Option<T> and reject nested payloads at compile time

Testing

  • cargo test -p partially_derive
  • cargo test -p partially
Open in Web Open in Cursor 

cursoragent and others added 2 commits March 25, 2026 01:28
Co-authored-by: Ben Greenier <ben@bengreenier.com>
Co-authored-by: Ben Greenier <ben@bengreenier.com>
@bengreenier bengreenier added the enhancement New feature or request label Mar 25, 2026
Co-authored-by: Ben Greenier <ben@bengreenier.com>
@cursor cursor Bot changed the title feat(derive): support nested partial fields transparently feat(derive): add explicit nested field option Mar 25, 2026
Co-authored-by: Ben Greenier <ben@bengreenier.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants