Skip to content

WrapperGenerator: generalize the passwordProfile pattern for flattening required complex-type parameters #3690

Description

@Joywambui-maina

Problem

Parameter extraction (SchemaProperties.ExtractPrimitiveProperties) is intentionally
shallow: top-level scalars and scalar arrays only; nested complex types are skipped.
passwordProfile is the one hard-coded exception (SchemaProperties.HasPasswordProfile)
because Graph requires it to create a user — without the flattened -Password /
-ForceChangePasswordNextSignIn parameters, New-MgUser would be unusable. As the only
known required complex type it's a reasonable special case today, but if other types
need the same treatment, copying the pattern one-off each time becomes accidental
technical debt.

Possible path forward

  • Survey Graph schemas for complex-type properties that are required (or required in
    practice) on POST/PATCH bodies, to size the real problem before designing.
  • Replace the hard-coded check with a data-driven mechanism — e.g. a checked-in table in
    the style of NamingOverrides mapping type/property → flattened parameters, or a
    general "flatten one level of a required complex type's scalar properties" rule.
  • Define a collision rule for when a flattened name clashes with a top-level property.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions