Skip to content

Add facets TypeSpec docs + reconcile pattern comparison table#1

Merged
mary-wan merged 2 commits into
mary-wan:marynjenga/graph-patternsfrom
J-Mumo:graph-facets-typespec-example
Jun 24, 2026
Merged

Add facets TypeSpec docs + reconcile pattern comparison table#1
mary-wan merged 2 commits into
mary-wan:marynjenga/graph-patternsfrom
J-Mumo:graph-facets-typespec-example

Conversation

@J-Mumo

@J-Mumo J-Mumo commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Stacks the facets TypeSpec documentation on top of @mary-wan's subtypes/flat-bag PR (microsoft#588) and reconciles the shared comparison table so the two efforts don't collide when they reach vNext.

Targets marynjenga/graph-patterns (not vNext) so the GuidelinesGraph.md table conflict is resolved once, here, before your branch merges up.

What this adds on top of your branch

  • graph/patterns/facets.md — new Facets in TypeSpec section: a driveItem example (audio/file/folder/image/video as @facet nullable @complex properties), the linter rules, and the compiled CSDL.
  • graph/GuidelinesGraph.md — reconciles the TypeSpec representation column so all three rows are correct:
    Pattern TypeSpec
    Type hierarchy @abstract + extends
    Facets @facet
    Flat bag @flatBag + @variant

Why the table needed reconciling

Both your branch and my original facets branch rewrote the same 5 table rows from the same base, so they were a guaranteed merge conflict. The content also disagreed: your branch had Facets = — (but @facet ships in v1.1.0), and my branch had Flat bag = "no dedicated decorator" (wrong — @flatBag/@variant ship too). This PR merges both decorator sets into one correct table.

All decorator/CSDL claims were verified by compiling canaries against @microsoft/typespec-msgraph v1.1.0.

🤖 AI-assisted authoring (GitHub Copilot).

Joel Ngei (from Dev Box) added 2 commits June 22, 2026 19:41
Documents how the facets API design pattern is authored in TypeSpec using
the @facet decorator from @microsoft/typespec-msgraph (issue
microsoftgraph/typespec-msgraph#1061, Phase 6):

- facets.md: new "Facets in TypeSpec" section with a driveItem example
  (audio/file/folder/image/video as @facet nullable @complex properties),
  the linter rules, and the compiled CSDL (a standard nullable complex
  property -- @facet is authoring/lint-only and emits no CSDL annotation).
- GuidelinesGraph.md: add a "TypeSpec representation" column to the
  modeling-variants comparison table and a pointer to the new section.
Merges marynjenga/graph-patterns (PR microsoft#588) into the facets branch and
resolves the GuidelinesGraph.md conflict where both branches rewrote the
modeling-variants comparison table.

Reconciled the shared 'TypeSpec representation' column so all three rows are
correct against @microsoft/typespec-msgraph v1.1.0 (verified by compiling
canaries):
- Type hierarchy -> `@abstract` + `extends`
- Facets         -> `@facet` on a nullable `@complex` property
- Flat bag       -> `@flatBag` + `@variant`

The prior facets-branch cell ('plain entity properties (no dedicated
decorator)') was incorrect -- @flatBag/@variant ship in v1.1.0 -- and Mary's
'Facets = —' cell was incomplete since @facet ships as well. The merged table
captures both decorator sets.
@mary-wan mary-wan merged commit 7a620c9 into mary-wan:marynjenga/graph-patterns Jun 24, 2026
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.

2 participants