Skip to content

Commit

Permalink
add new rule XmsIdentifierValidation doc (#17076)
Browse files Browse the repository at this point in the history
* add new rule XmsIdentifierValidation doc

* fix comment

* fix comment

* fix comment

Co-authored-by: Tianxiang Chen <[email protected]>
  • Loading branch information
tianxchen-ms and Tianxiang Chen authored Dec 16, 2021
1 parent 79751e0 commit eeb8e0a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions documentation/openapi-authoring-automated-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
| [R4037](#r4037) | [MissingTypeObject](#r4037) | ARM and Data plan OpenAPI(swagger) specs |
| [R4039](#r4039) | [ParametersOrder](#r4039) | ARM and Data plan OpenAPI(swagger) specs |
| [R4040](#r4040) | [EnumMustRespectType](#r4040) | ARM and Data plan OpenAPI(swagger) specs |
| [R4041](#r4041) | [XmsIdentifierValidation](#r4041) | ARM OpenAPI(swagger) specs |
#### SDK Warnings

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

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)

### <a name="r4041"></a>R4041 XmsIdentifierValidation

**Category** : SDK Error

**Applies to** : ARM OpenAPI(swagger) specs

**Output Message** : Missing identifier {0} in array item property.

**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).

**CreatedAt**: Decenmber 15, 2021

**LastModifiedAt**: Decenmber 15, 2021

**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.

**How to fix the violation**:
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`.

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 comments on commit eeb8e0a

Please sign in to comment.