Skip to content

Auto-flattening with init/required support #82

Description

@superyyrrzz

Summary

Implement auto-flattening by PascalCase convention with proper init/required property support.

Originally Feature 2 in the v1.4 spec (docs/SPEC-v1.4-advanced-mapping.md), moved to v1.5 to prioritize issues #80 and #81.

Key Points

  • Auto-resolve unmatched destination properties by splitting PascalCase names and walking the source object graph (e.g., CustomerNamesource.Customer.Name)
  • Route init/required properties to object initializer (fixes what's broken in Mapperly since mid-2023)
  • Greedy match algorithm with configurable case sensitivity
  • Unflattening support via [ReverseForge]
  • Controllable via AutoFlatten property on [ForgeMap] / [ForgeMapDefaults]

Diagnostics

  • FM0033 (Info): Property auto-flattened notification
  • FM0034 (Error): Unflattening target type not constructible
  • FM0035 (Warning): Property cannot be unflattened

See docs/SPEC-v1.4-advanced-mapping.md Feature 2 for full specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions