Skip to content

Commit eeb8e0a

Browse files
tianxchen-msTianxiang Chen
andauthored
add new rule XmsIdentifierValidation doc (#17076)
* add new rule XmsIdentifierValidation doc * fix comment * fix comment * fix comment Co-authored-by: Tianxiang Chen <[email protected]>
1 parent 79751e0 commit eeb8e0a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

documentation/openapi-authoring-automated-guidelines.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
120120
| [R4037](#r4037) | [MissingTypeObject](#r4037) | ARM and Data plan OpenAPI(swagger) specs |
121121
| [R4039](#r4039) | [ParametersOrder](#r4039) | ARM and Data plan OpenAPI(swagger) specs |
122122
| [R4040](#r4040) | [EnumMustRespectType](#r4040) | ARM and Data plan OpenAPI(swagger) specs |
123+
| [R4041](#r4041) | [XmsIdentifierValidation](#r4041) | ARM OpenAPI(swagger) specs |
123124
#### SDK Warnings
124125

125126
| Id | Rule Name | Applies to |
@@ -3579,3 +3580,24 @@ Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rul
35793580
Just change the enum value to the right type.
35803581

35813582
Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rules](#automated-rules) | [ARM](#arm-violations): [Errors](#arm-errors) or [Warnings](#arm-warnings) | [SDK](#sdk-violations): [Errors](#sdk-errors) or [Warnings](#sdk-warnings)
3583+
3584+
### <a name="r4041"></a>R4041 XmsIdentifierValidation
3585+
3586+
**Category** : SDK Error
3587+
3588+
**Applies to** : ARM OpenAPI(swagger) specs
3589+
3590+
**Output Message** : Missing identifier {0} in array item property.
3591+
3592+
**Description**: This rule is to check the `id` property or identifier of objects in the array. See more here: [x-ms-identifiers](https://github.com/Azure/autorest/tree/main/docs/extensions#x-ms-identifiers).
3593+
3594+
**CreatedAt**: Decenmber 15, 2021
3595+
3596+
**LastModifiedAt**: Decenmber 15, 2021
3597+
3598+
**Why this rule is important**: Using [x-ms-identifiers](https://github.com/Azure/autorest/tree/main/docs/extensions#x-ms-identifiers) will provide more flexibility for array types in SDK generated code.
3599+
3600+
**How to fix the violation**:
3601+
If you don't need identifier in array, leave `x-ms-identifiers` as an empty array. Otherwise, add the identifying property in the object or correct the `x-ms-identifiers`.
3602+
3603+
Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rules](#automated-rules) | [ARM](#arm-violations): [Errors](#arm-errors) or [Warnings](#arm-warnings) | [SDK](#sdk-violations): [Errors](#sdk-errors) or [Warnings](#sdk-warnings)

0 commit comments

Comments
 (0)