Add facets TypeSpec docs + reconcile pattern comparison table#1
Merged
mary-wan merged 2 commits intoJun 24, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(notvNext) so theGuidelinesGraph.mdtable 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: adriveItemexample (audio/file/folder/image/videoas@facetnullable@complexproperties), the linter rules, and the compiled CSDL.graph/GuidelinesGraph.md— reconciles the TypeSpec representation column so all three rows are correct:@abstract+extends@facet@flatBag+@variantWhy 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
@facetships in v1.1.0), and my branch had Flat bag = "no dedicated decorator" (wrong —@flatBag/@variantship too). This PR merges both decorator sets into one correct table.All decorator/CSDL claims were verified by compiling canaries against
@microsoft/typespec-msgraphv1.1.0.