Skip to content

Commit f69ff78

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into ANF-8208-UpdateSwaggerRestAPI-to-2020-09-01
2 parents bf3339d + 8869dfe commit f69ff78

File tree

442 files changed

+47840
-1406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+47840
-1406
lines changed

.azure-pipelines/Avocado.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.azure-pipelines/LintDiff.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.azure-pipelines/ModelValidation.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.azure-pipelines/Semantic.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/pull_request_assignment.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,24 @@
3838
- kairu-ms
3939

4040
- rule:
41-
paths: "specification/@(resources|powerplatform)/**"
41+
paths: "specification/@(resources|powerplatform|appplatform)/**"
4242
reviewers:
4343
- raych1
44+
45+
- rule:
46+
paths: "specification/sql/**"
47+
reviewers:
48+
- akning-ms
4449

50+
- rule:
51+
paths: "specification/signalr/**"
52+
reviewers:
53+
- leni-msft
54+
55+
- rule:
56+
paths: "specification/eventhub/**"
57+
reviewers:
58+
- ruowan
4559
- rule:
4660
paths: "specification/compute/**"
4761
reviewers:
@@ -57,7 +71,7 @@
5771

5872
- rule:
5973
paths:
60-
- "specification/@(azureactivedirectory|appplatform)/**"
74+
- "specification/azureactivedirectory/**"
6175
reviewers:
6276
- njuCZ
6377

azure-pipelines.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ variables:
2020
jobs:
2121
- template: .azure-pipelines/BranchProtectionForPrivateRepo.yml
2222
- template: .azure-pipelines/Syntax.yml
23-
- template: .azure-pipelines/Semantic.yml
24-
- template: .azure-pipelines/Avocado.yml
25-
- template: .azure-pipelines/ModelValidation.yml
26-
- template: .azure-pipelines/LintDiff.yml
2723
- template: .azure-pipelines/NetworkValidation.yml
2824
- template: .azure-pipelines/Spellcheck.yml
2925
- template: .azure-pipelines/PrettierCheck.yml

documentation/ci-fix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ Refer to [Oad Docs](https://github.com/Azure/openapi-diff/tree/master/docs) for
6363
Run linter locally:
6464
```
6565
npm install -g autorest
66-
autorest --validation --azure-validator --input-file=<path-to-spec>
66+
autorest --validation --azure-validator --use=@microsoft.azure/classic-openapi-validator@latest --use=@microsoft.azure/openapi-validator@latest --input-file=<path-to-spec>
6767
or
68-
autorest --validation --azure-validator <path-to-readme>
68+
autorest --validation --azure-validator --use=@microsoft.azure/classic-openapi-validator@latest --use=@microsoft.azure/openapi-validator@latest [--tag=<readme tag>] <path-to-readme>
6969
7070
```
7171
Please see [readme](https://github.com/Azure/azure-openapi-validator/blob/master/README.md) for how to install or run tool in details.

documentation/openapi-authoring-automated-guidelines.md

Lines changed: 217 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
109109
| [R4008](#r4008) | [AvoidEmptyResponseSchema](#r4008) | ARM OpenAPI(swagger) specs |
110110
| [R4012](#r4012) | [XmsPageableMustHaveCorrespondingResponse](#r4012) | ARM OpenAPI(swagger) specs |
111111
| [R4013](#r4013) | [IntegerTypeMustHaveFormat](#r4013) | ARM OpenAPI(swagger) specs |
112+
| [R4028](#r4028) | [ValidResponseCodeRequired](#r4028) | ARM OpenAPI(swagger) specs |
113+
| [R4029](#r4029) | [UniqueClientParameterName](#r4029) | ARM OpenAPI(swagger) specs |
112114

113115
#### SDK Warnings
114116

@@ -141,6 +143,7 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
141143
| [R2029](#r2029) | [PageableOperation](#r2029) | ARM and Data plane OpenAPI(swagger) specs |
142144
| [R4006](#r4006) | [DeprecatedXmsCodeGenerationSetting](#r4006) | ARM and Data plane OpenAPI(swagger) specs |
143145
| [R4024](#r4024) | [PreviewVersionOverOneYear](#r4024) | ARM OpenAPI(swagger) specs |
146+
| [R4030](#r4030) | [UniqueXmsExample](#r4030) | ARM OpenAPI(swagger) specs |
144147

145148

146149
### RPaaS Violations
@@ -150,6 +153,8 @@ We request OpenAPI(Swagger) spec authoring be assigned to engineers who have an
150153
| Id | Rule Name | Applies to |
151154
| --- | --- | --- |
152155
| [R4023](#r4023) | [RPaasPutLongRunningOperation201Only](#r4023) | ARM OpenAPI(swagger) specs |
156+
| [R4025](#r4025) | [RPaasDeleteLongRunningOperation202Only](#r4025) | ARM OpenAPI(swagger) specs |
157+
| [R4026](#r4026) | [RPaasPostLongRunningOperation202Only](#r4026) | ARM OpenAPI(swagger) specs |
153158

154159
### Documentation
155160

@@ -2929,13 +2934,13 @@ Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rul
29292934

29302935
**Output Message** : [RPaaS] Only 201 is the supported response code for PUT async response
29312936

2932-
**Description** : An async PUT operation response include status code 201 with Azure-async-operation header. Must also support status code 200, for simple updates that can be completed synchronously (ex: tags). Operation must also add "x-ms-long-running-operation and x-ms-long-running-operation-options" to describe how the long running operation is tracked.
2937+
**Description** : An async PUT operation response include status code 201 with 'Azure-async-operation' header. Must also support status code 200, for simple updates that can be completed synchronously (ex: tags). Operation must also add "x-ms-long-running-operation and x-ms-long-running-operation-options" to mark that it is a long running operation (in case of 201) and how it is tracked (Azure-async-operation header).
29332938

29342939
**CreatedAt**: August 10, 2020
29352940

29362941
**LastModifiedAt**: August 10, 2020
29372942

2938-
**Why this rule is important**: RPaaS only supports 201 for async operations. This is enforced at runtime via swagger validation.
2943+
**Why this rule is important**: RPaaS only supports 201 for async PUT operations. This is enforced at runtime via swagger validation.
29392944

29402945
**How to fix the violation**: Add the following for async PUT operations.
29412946

@@ -2990,3 +2995,213 @@ Links: [Index](#index) | [Error vs. Warning](#error-vs-warning) | [Automated Rul
29902995

29912996
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)
29922997

2998+
### <a name="r4025"></a>R4025 RPaasDeleteLongRunningOperation202Only
2999+
3000+
**Category** : RPaaS Error
3001+
3002+
**Applies to** : ARM OpenAPI(swagger) specs
3003+
3004+
**Output Message** : [RPaaS] DELETE async supports
3005+
3006+
**Description** : An async DELETE operation response include status code 202 with 'Location' header. Must support status code 200 if operation can be completed synchronously. Must support 204 (resource doesn't exists). Operation must also add "x-ms-long-running-operation and x-ms-long-running-operation-options" to mark that it is a long running operation (in case of 202) and how it is tracked (Location header).
3007+
3008+
**CreatedAt**: November 12, 2020
3009+
3010+
**LastModifiedAt**: November 12, 2020
3011+
3012+
**Why this rule is important**: RPaaS only supports 202 for async DELETE operations. This is enforced at runtime via swagger validation.
3013+
3014+
**How to fix the violation**: Add the following for async DELETE operations.
3015+
3016+
The following would be valid:
3017+
3018+
```json
3019+
...
3020+
"responses": {
3021+
"202": {
3022+
"description": "Delete operation accepted",
3023+
},
3024+
"200": {
3025+
"description": "Delete operation succeeded"
3026+
},
3027+
"204": {
3028+
"description": "Resource doesn't exist. Delete operation completed."
3029+
},
3030+
"default": {
3031+
"description": "Error response describing why the operation failed.",
3032+
"schema": {
3033+
"$ref": "#/definitions/ErrorResponse"
3034+
}
3035+
}
3036+
},
3037+
"x-ms-long-running-operation": true,
3038+
"x-ms-long-running-operation-options": {
3039+
"final-state-via": "location"
3040+
}
3041+
...
3042+
```
3043+
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)
3044+
3045+
### <a name="r4026"></a>R4026 RPaasPostLongRunningOperation202Only
3046+
3047+
**Category** : RPaaS Error
3048+
3049+
**Applies to** : ARM OpenAPI(swagger) specs
3050+
3051+
**Output Message** : [RPaaS] POST async supports
3052+
3053+
**Description** : An async POST operation response include status code 202 with 'Location' header. Must support status code 200 if operation can be completed synchronously. Operation must also add "x-ms-long-running-operation and x-ms-long-running-operation-options" to mark that it is a long running operation (in case of 202) and how it is tracked (Location header).
3054+
3055+
**CreatedAt**: November 12, 2020
3056+
3057+
**LastModifiedAt**: November 12, 2020
3058+
3059+
**Why this rule is important**: RPaaS only supports 202 for async POST operations. This is enforced at runtime via swagger validation.
3060+
3061+
**How to fix the violation**: Add the following for async POST operations.
3062+
3063+
The following would be valid:
3064+
3065+
```json
3066+
...
3067+
"responses": {
3068+
"202": {
3069+
"description": "Operation accepted",
3070+
},
3071+
"200": {
3072+
"description": "Operation completed"
3073+
},
3074+
"default": {
3075+
"description": "Error response describing why the operation failed.",
3076+
"schema": {
3077+
"$ref": "#/definitions/ErrorResponse"
3078+
}
3079+
}
3080+
},
3081+
"x-ms-long-running-operation": true,
3082+
"x-ms-long-running-operation-options": {
3083+
"final-state-via": "location"
3084+
}
3085+
...
3086+
```
3087+
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)
3088+
3089+
### <a name="r4028" ></a>R4028 ValidResponseCodeRequired
3090+
3091+
**Category** : SDK Error
3092+
3093+
**Applies to** : ARM OpenAPI(swagger) specs
3094+
3095+
**Output Message** : There is no declared valid status code.
3096+
3097+
**Description** : Every operation response must contain a valid code like "200","201","202" or "204" which indicates the operation is succeed and it's not allowed that a response schema just contains a "default" code.
3098+
3099+
**Why this rule is important**: If a Swagger just contains "default" status code, this actually means "everything is an error". All track2 SDK will systematically raise an exception at runtime, if there is no declared valid status code.
3100+
3101+
**CreatedAt**: November 23, 2020
3102+
3103+
**LastModifiedAt**: November 23, 2020
3104+
3105+
**How to fix the violation**: Add a valid response code .
3106+
The following would be valid:
3107+
3108+
```json
3109+
...
3110+
"responses": {
3111+
"200": {
3112+
"description": "Succeeded",
3113+
"schema": {
3114+
"$ref": "#/definitions/MySimpleResource"
3115+
}
3116+
},
3117+
"default": {
3118+
"description": "Error response describing why the operation failed.",
3119+
"schema": {
3120+
"$ref": "#/definitions/ErrorResponse"
3121+
}
3122+
}
3123+
}
3124+
}
3125+
...
3126+
```
3127+
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)
3128+
3129+
### <a name="r4029" ></a>R4029 UniqueClientParameterName
3130+
3131+
**Category** : SDK Error
3132+
3133+
**Applies to** : ARM OpenAPI(swagger) specs
3134+
3135+
**Output Message** : Do not have duplicate name of client parameter name, make sure every client parameter name unique.
3136+
3137+
**Description** : This may cause a problem when different swagger files come together. If two APIs with different client name have the same client parameter subscriptionId, but with different reference name in swaggers, the generated model will also have two clients with two client parameters subscriptionId and subscriptionId1 (the latter one has been renamed to avoid collision). We should ensure that the client parameters are all unique in the same API version.
3138+
3139+
**Why this rule is important**: Make sure no conflict in SDK generation.
3140+
3141+
**CreatedAt**: November 30, 2020
3142+
3143+
**LastModifiedAt**: November 30, 2020
3144+
3145+
**How to fix the violation**: Remove duplicate client parameter, ref to the same one.
3146+
The following would be valid:
3147+
3148+
```json
3149+
...
3150+
"/api": {
3151+
"get": {
3152+
"parameters": [
3153+
{
3154+
"$ref": "#/parameters/ApiVersionParameter"
3155+
},
3156+
{
3157+
// ref to the same subcriptionId
3158+
"$ref": "#/parameters/subscriptionIdParameter"
3159+
},
3160+
],
3161+
},
3162+
"patch": [
3163+
{
3164+
"$ref": "#/parameters/ApiVersionParameter"
3165+
},
3166+
{
3167+
"$ref": "#/parameters/subscriptionIdParameter"
3168+
},
3169+
]
3170+
}
3171+
...
3172+
```
3173+
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)
3174+
3175+
### <a name="r4030" ></a>R4030 UniqueXmsExample
3176+
3177+
**Category** : SDK Warning
3178+
3179+
**Applies to** : ARM OpenAPI(swagger) specs
3180+
3181+
**Output Message** : Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: {ExampleName}
3182+
3183+
**Description** : x-ms-example name should be unique in the same API version.
3184+
3185+
**Why this rule is important**: Duplicate example name will bring trouble for test codegen. For example: hard to config used example.
3186+
3187+
**CreatedAt**: November 30, 2020
3188+
3189+
**LastModifiedAt**: November 30, 2020
3190+
3191+
**How to fix the violation**: Rename duplicate x-ms-example name
3192+
The following would be valid:
3193+
3194+
```json
3195+
...
3196+
"x-ms-examples": {
3197+
"Create resource": {
3198+
"$ref": "./examples/createResource"
3199+
},
3200+
"Update resource":{
3201+
"$ref": "./examples/updateResource"
3202+
}
3203+
3204+
}
3205+
...
3206+
```
3207+
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)

preproduction-azure-pipelines.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)