-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ced4e4
commit eb94be6
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/AvoidAdditionalProperties-2024-1-23-10-13-55.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@azure-tools/typespec-azure-resource-manager" | ||
--- | ||
|
||
Add `arm-avoid-additional-properties` rule. |
27 changes: 27 additions & 0 deletions
27
docs/libraries/azure-resource-manager/rules/avoid-additional-properties.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: avoid-additional-properties | ||
--- | ||
|
||
```text title=- Full name- | ||
@azure-tools/typespec-azure-resource-manager/avoid-additional-properties | ||
``` | ||
|
||
ARM requires Resource provider teams to define types explicitly. This is to ensure good customer experience in terms of the discoverability of concrete type definitions. | ||
|
||
#### ❌ Incorrect | ||
|
||
```tsp | ||
model Address extends Record<string> {} | ||
``` | ||
|
||
#### ✅ Correct | ||
|
||
```tsp | ||
model Address { | ||
street: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
postalCode: string; | ||
} | ||
``` |
This file contains 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