Azure / Azure/typespec-azure

[Lint] report warning if resource type key is not read-only in ResourceCreateOrReplace template

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

Description

As we offlined discussed this is a real case in [contentsafety ](https://github.com/Azure/azure-rest-api-specs/blob/14d24d17491d8c2bde24532cb8cc2d663c0ffd9f/specification/cognitiveservices/ContentSafety/models.tsp#L134-L147), for Azure template `ResourceCreateOrReplace` it would lift the key properties to method level as path parameters, so there would exist duplications between path paramter and request body property and it's better to add a linter to limit the key property as read-only so that we could guide spec author without duplications.

Contributor guide

Open the contributing guide

Research direction

Start with the ContentSafety models.tsp example linked in the issue and trace how the ResourceCreateOrReplace template handles key properties. Add a linter warning for key properties that are not read-only, and verify that the warning prevents duplicated path and request-body properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.