Skip to content

Compare nested Relationship endpoint model shape#4893

Draft
alexchro93 wants to merge 2 commits into
mainfrom
chrostow/nested-relationship-model
Draft

Compare nested Relationship endpoint model shape#4893
alexchro93 wants to merge 2 commits into
mainfrom
chrostow/nested-relationship-model

Conversation

@alexchro93

Copy link
Copy Markdown
Member

Summary

This draft PR is an alternate implementation of #4892 for comparison. It keeps the same experimental ARM Relationship base type feature, but models relationship endpoints as nested objects instead of flat properties.

The resulting relationship properties shape is:

source: RelationshipSource;
target: RelationshipTarget;
metadata?: RelationshipMetadata;

Where endpoint-specific details live under the endpoint objects:

{
  "source": { "id": "...", "type": "..." },
  "target": { "id": "...", "type": "...", "tenant": "..." },
  "metadata": {}
}

Notable differences from #4892

  • Replaces top-level sourceId, targetId, and targetTenant with source and target object properties.
  • Moves source/target type metadata from RelationshipMetadata into source.type and target.type.
  • Leaves RelationshipMetadata for RP-defined relationship metadata.
  • Updates the required-properties linter to validate nested endpoint models.
  • Regenerates the relationship sample OpenAPI output and ARM reference docs.

Validation

  • pnpm -r --filter "@azure-tools/typespec-azure-resource-manager..." build
  • pnpm --filter @azure-tools/typespec-azure-resource-manager test -- arm-relationship-base-type-required-properties
  • pnpm --filter @azure-tools/typespec-samples test:regen -- -t relationship
  • pnpm --filter @azure-tools/typespec-samples test -- -t relationship
  • git diff --check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8a6e07d6-3bd4-4373-b9a2-88ad69127fcf
Move relationship source and target details into nested endpoint models so source/target identifiers, types, and target tenant are grouped together. Keep RelationshipMetadata for RP-defined metadata and update linter validation, docs, and sample output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4adc4a5f-101a-4e32-9be7-e1525b252f8a
@microsoft-github-policy-service microsoft-github-policy-service Bot added int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates linter Issues related to linter rules labels Jul 14, 2026
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @azure-tools/typespec-azure-rulesets

The following packages have already been documented:

  • @azure-tools/typespec-azure-resource-manager
Show changes

@azure-tools/typespec-azure-resource-manager - feature ✏️

Add the experimental Relationship base type for Azure Resource Manager extension resources, including nested source and target endpoint properties and lint validation for Relationship base type conformance.

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@4893
npm i https://pkg.pr.new/@azure-tools/typespec-azure-rulesets@4893

commit: 77ece5c

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant