feat(source-generators): opt-in base class property mapping#68
feat(source-generators): opt-in base class property mapping#68ncipollina merged 1 commit intomainfrom
Conversation
Add IncludeBaseClassProperties to DynamoMapperAttribute and generator options to include inherited properties for root models, nested inline objects, and dot-notation validation. Update docs and add an inheritance example and generator snapshot tests. Bump package versions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 660faf96f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var property = current | ||
| .GetMembers() | ||
| .OfType<IPropertySymbol>() | ||
| .FirstOrDefault(p => p.Name == name); |
There was a problem hiding this comment.
Ignore non-mappable derived properties in base lookup
With IncludeBaseClassProperties = true, dot-notation validation calls FindPropertyByName and will return the first property name match even if it’s non-mappable (e.g., static/indexer). This lets a derived non-mappable property shadow a base instance property, causing valid paths like Address.Line1 to fail validation even though the base Address property is the one actually mapped. This regression only appears with base-property opt-in plus a same-named non-mappable member on the derived type; consider applying the same mappability predicate (or at least skipping static/indexers) when resolving the path so base properties remain reachable.
Useful? React with 👍 / 👎.
🚀 Pull Request
📋 Summary
✅ Checklist
🧪 Related Issues or PRs
Closes #...
💬 Notes for Reviewers