Azure / Azure/typespec-azure

Consider add @Private.enforceConstraint(Resource, Foundations.Resource) to the legacy operations

Open
#2,780 0 comments 0 reactions 0 assignees View on GitHub
feature lib:azure-resource-manager
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

If we don't have such constraint, users could pass in any model into the operation. Even the models not marked as resource or customResource can be passed in. As a consequence, resolveArmResources cannot resolve correct results. This will confuse customers.

Contributor guide

Open the contributing guide

Research direction

Locate the legacy operations and the resolveArmResources entry point, then inspect how @Private.enforceConstraint is applied to resource models. Add the stated Resource and Foundations.Resource constraint where appropriate, and verify that non-resource models are rejected while valid resources resolve correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.