Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lint rule R4005,R4006 to guidelines doc #8770

Merged
merged 7 commits into from
Apr 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions documentation/openapi-authoring-automated-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
| [R3028](#r3028) | [TrackedResourceListBySubscription](#r3028) | ARM OpenAPI(swagger) specs |
| [R3011](#r3011) | [DescriptionMustNotBeNodeName](#r3011) | ARM and Data plane OpenAPI(swagger) specs |
| [R2020](#r2020) | [RequiredPropertiesMissingInResourceModel](#r2020) | ARM OpenAPI(swagger) specs |
| [R4005](#r4005) | [UniqueXmsEnumName](#r4005) | ARM and Data plane OpenAPI(swagger) specs |

#### ARM Warnings

Expand All @@ -66,8 +67,7 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
| [R3015](#r3015) | [EnumMustHaveType](#r3015) | ARM OpenAPI(swagger) specs |
| [R3024](#r3024) | [EnumUniqueValue](#r3024) | ARM OpenAPI(swagger) specs |
| [R3029](#r3029) | [EnumMustNotHaveEmptyValue](#r3024) | ARM OpenAPI(swagger) specs |
| [R4005](#r4005) | [XmsEnumNameUnique](#r4005) | ARM OpenAPI(swagger) specs |
| [R4006](#r4006) | [XmsCodeGenerationSettingDeprecated](#r4006) | ARM OpenAPI(swagger) specs |
| [R4006](#r4006) | [DeprecatedXmsCodeGenerationSetting](#r4006) | ARM and Data plane OpenAPI(swagger) specs |

### SDK Violations

Expand Down Expand Up @@ -2239,15 +2239,15 @@ Eg:

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="r4005" ></a>R4005 XmsEnumNameUnique
### <a name="r4005" ></a>R4005 UniqueXmsEnumName

**Category** : ARM Warning
**Category** : ARM Error

**Applies to** : ARM OpenAPI(swagger) specs
**Applies to** : ARM and Data plane OpenAPI(swagger) specs
jianyexi marked this conversation as resolved.
Show resolved Hide resolved

**Output Message** : Must not have duplicate name in x-ms-enum extension , make sure every x-ms-enum name unique.
jianyexi marked this conversation as resolved.
Show resolved Hide resolved

**Description** : Property name in x-ms-extension is required , the rule introduce to avoid duplicate x-ms-enum name.
**Description** : Property name in x-ms-extension is required , the rule introduced to avoid duplicate x-ms-enum name.
jianyexi marked this conversation as resolved.
Show resolved Hide resolved

**CreatedAt**: March 18, 2020

Expand All @@ -2258,7 +2258,7 @@ Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rul
The following would be invalid:
```json
"State": {
"description": "The state of the configuration store.",
"description": "The state of the configuration store.",
"enum": [
"Failed",
"Canceled"
Expand Down Expand Up @@ -2288,21 +2288,21 @@ The following would be invalid:

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="r4006" ></a>R4006 XmsCodeGenerationSettingDeprecated
### <a name="r4006" ></a>R4006 DeprecatedXmsCodeGenerationSetting

**Category** : ARM Warning

**Applies to** : ARM OpenAPI(swagger) specs
**Applies to** : ARM and Data plane OpenAPI(swagger) specs

**Output Message** : The x-ms-code-generation-settings extenison was deprecated. Consider remove it from the swagger.
**Output Message** : The x-ms-code-generation-setting extension is being deprecated. Please remove it and move settings to readme file for code generation.

**Description** : New autorest (V3) will stop supporting “x-ms-code-generation-settings” inside the Swagger. This was designed before there was Readme.md to hold configuration options, and this node should disappear and be replaced by actual readme descriptions.
**Description** : x-ms-code-generation-settings is being deprecated. AutoRest (v3) will stop supporting it inside the Swagger. There was Readme.md to hold the same configuration options. Please ensure to remove the parameter from swagger spec and move settings to readme.
jianyexi marked this conversation as resolved.
Show resolved Hide resolved

**CreatedAt**: March 18, 2020

**LastModifiedAt**: March 18, 2020

**How to fix the violation**: The only value of this node today is to override the client name, which could be done with a “title” line in the Readme, and some C# only options that could be done readme.csharp.me (and those options disappears anyway with the new codegen for Csharp).
**How to fix the violation**: Since the only value of this extension today is to override the client name, which could be done with a “title” line in the Readme,you could remove the extension from swagger spec and move settings to readme.
jianyexi marked this conversation as resolved.
Show resolved Hide resolved

jianyexi marked this conversation as resolved.
Show resolved Hide resolved
The following would be invalid:

Expand Down