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

[Hub Generated] Review request for Microsoft.Authorization to add version preview/2020-04-01-preview #11506

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2644905
Adds base for updating Microsoft.Authorization from version preview/2…
dagoroz Jun 5, 2020
64382bd
Updates readme
dagoroz Jun 5, 2020
fc9df71
Updates API version in new specs and examples
dagoroz Jun 5, 2020
505b1ff
add new properties
dagoroz Jun 13, 2020
6500abc
update readme instructions
dagoroz Jun 17, 2020
dff6178
format
dagoroz Jun 18, 2020
dbae1dc
bump
dagoroz Jun 19, 2020
89db37d
Adds suppression to readme
dagoroz Jun 18, 2020
c556228
Adds suppression to readme
dagoroz Jun 18, 2020
5715f1a
Adds suppression to readme
dagoroz Jun 19, 2020
690f806
Adds suppression to readme
dagoroz Jun 19, 2020
272dcf5
Adds suppression to readme
dagoroz Jun 19, 2020
a897978
Adds suppression to readme
dagoroz Jun 19, 2020
78ce124
Adds suppression to readme
dagoroz Jun 19, 2020
638a679
merge
dagoroz Jun 19, 2020
7f494b8
Adds suppression to readme
dagoroz Jun 19, 2020
5b75826
Adds suppression to readme
dagoroz Jun 19, 2020
7b1110a
Adds suppression to readme
dagoroz Jun 19, 2020
c2483ef
Adds suppression to readme
dagoroz Jun 19, 2020
f452317
Adds suppression to readme
dagoroz Jun 19, 2020
03fc50f
Adds suppression to readme
dagoroz Jun 19, 2020
81b50fc
bump validations
dagoroz Jun 26, 2020
eed9ef4
test suppressions
dagoroz Jun 26, 2020
389dab0
return supresions
dagoroz Jun 26, 2020
788edfc
run prettier-fix
dagoroz Jun 26, 2020
1fa87b5
remove unused examples
dagoroz Jun 26, 2020
59ce762
fix tag label
dagoroz Jul 6, 2020
78a1b07
add condition and description to examples
dagoroz Jul 6, 2020
89332e6
add explanation to new fields
dagoroz Jul 6, 2020
75537b7
format
dagoroz Jul 6, 2020
9244557
Merge branch 'master' of https://github.com/Azure/azure-rest-api-spec…
dagoroz Nov 2, 2020
f999d05
added missing response errors
dagoroz Nov 2, 2020
0679acc
add missing response codes in examples
dagoroz Nov 2, 2020
d82ca04
fix error object
dagoroz Nov 2, 2020
366e7d1
add missing codes
dagoroz Nov 2, 2020
813df18
more missing codes
dagoroz Nov 2, 2020
9ea51bf
more stuff
dagoroz Nov 2, 2020
6385ef3
remove unused stuff
dagoroz Nov 3, 2020
56f3706
move examples
dagoroz Nov 3, 2020
5ac2583
add response to example
dagoroz Nov 3, 2020
013e19b
add default responses
dagoroz Nov 3, 2020
0db4882
add error definition
dagoroz Nov 4, 2020
03f7313
add description to onject
dagoroz Nov 4, 2020
94f1537
remove defaults
dagoroz Nov 4, 2020
3e71e3c
remove defaults
dagoroz Nov 4, 2020
482ea93
orthography
dagoroz Nov 4, 2020
75312c7
prettifier
dagoroz Nov 4, 2020
b7d9841
add missing tag
dagoroz Dec 2, 2020
c704489
fix
dagoroz Dec 3, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@
}
},
"definitions": {
"Error": {
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Brief error code"
},
"message": {
"type": "string",
"description": "Longer message explaining the details of the error"
}
}
}
},
"description": "Object to be thrown in case of an unsuccessful response"
},
"ResourceType": {
"properties": {
"name": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,24 @@
}
},
"definitions": {
"Error": {
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Brief error code"
},
"message": {
"type": "string",
"description": "Longer message explaining the details of the error"
}
}
}
},
"description": "Object to be thrown in case of an unsuccessful response"
},
"RoleAssignmentFilter": {
"properties": {
"principalId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,24 @@
}
},
"definitions": {
"Error": {
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Brief error code"
},
"message": {
"type": "string",
"description": "Longer message explaining the details of the error"
}
}
}
},
"description": "Object to be thrown in case of an unsuccessful response"
},
"RoleDefinitionFilter": {
"properties": {
"roleName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,25 @@
}
},
"definitions": {
"Error": {
"properties": {
"error": {
"description": "Object to be thrown in case of an unsuccessful response",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Brief error code"
},
"message": {
"type": "string",
"description": "Longer message explaining the details of the error"
}
}
}
},
"description": "Object to be thrown in case of an unsuccessful response"
},
"DenyAssignmentFilter": {
"properties": {
"denyAssignmentName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@
"schema": {
"$ref": "#/definitions/RoleAssignmentListResult"
}
},
"400": {
"description": "Bad Request - Indicates the request has missing information and can not be completed",
"schema": {
"$ref": "#/definitions/Error"
}
Comment on lines +139 to +143
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dagoroz @yungezz could any one explain this to me, why we have to add these "error response code" into this list?
In the generated SDKs, the status code listed here will NOT be considered as errors.
To indicate errors, please put the errors in the default response.

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same opinion as @ArcturusZhang. If 400 is expected as error, it should be covered by default, not 400.

This change breaks track2 Java SDK, as RoleAssignmentListResult and Error is 2 completely different type. Hence the generated method will not able to figure out which type will be returned in runtime.

(go can return more than 1 class in single method, java cannot)

}
},
"x-ms-pageable": {
Expand Down Expand Up @@ -181,6 +187,12 @@
"schema": {
"$ref": "#/definitions/RoleAssignment"
}
},
"204": {
"description": "Deleted - Indicates correct deletion without returning additional info"
},
"412": {
"description": "Precondition Failed"
}
},
"x-ms-examples": {
Expand Down Expand Up @@ -230,6 +242,18 @@
"schema": {
"$ref": "#/definitions/RoleAssignment"
}
},
"400": {
"description": "Bad Request - Indicates the request has missing information and can not be completed",
"schema": {
"$ref": "#/definitions/Error"
}
},
"409": {
"description": "Conflict - indicates that the request could not be completed due to a conflict with the current state of the target resource",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"x-ms-examples": {
Expand Down Expand Up @@ -270,6 +294,15 @@
"schema": {
"$ref": "#/definitions/RoleAssignment"
}
},
"400": {
"description": "Bad Request - Indicates the request has missing information and can not be completed",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not Found - Indicates the specified role has not been found"
}
},
"x-ms-examples": {
Expand Down Expand Up @@ -417,6 +450,12 @@
"schema": {
"$ref": "#/definitions/RoleAssignmentListResult"
}
},
"400": {
"description": "Bad Request - Indicates the request has missing information and can not be completed",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"x-ms-pageable": {
Expand Down Expand Up @@ -463,6 +502,12 @@
"schema": {
"$ref": "#/definitions/RoleAssignmentListResult"
}
},
"400": {
"description": "Bad Request - Indicates the request has missing information and can not be completed",
"schema": {
"$ref": "#/definitions/Error"
}
}
Comment on lines +506 to 511
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the error response here is causing autorest generation failure - our convention is that the responses only list the successful status code that would return something from the service, not these error responses.

},
"x-ms-pageable": {
Expand Down Expand Up @@ -540,6 +585,28 @@
"conditionVersion": {
"type": "string",
"description": "Version of the condition. Currently accepted value is '2.0'"
},
"createdOn": {
"type": "string",
"description": "Time it was created",
"format": "date-time"
},
"updatedOn": {
"type": "string",
"description": "Time it was updated",
"format": "date-time"
},
"createdBy": {
"type": "string",
"description": "Id of the user who created the assignment"
},
"updatedBy": {
"type": "string",
"description": "Id of the user who updated the assignment"
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"description": "Id of the delegated managed identity resource"
}
},
"description": "Role assignment properties with scope."
Expand Down Expand Up @@ -650,6 +717,25 @@
"properties"
],
"description": "Role assignment create parameters."
},
"Error": {
"properties": {
"error": {
"description": "Object to be thrown in case of an unsuccessful response",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Brief error code"
},
"message": {
"type": "string",
"description": "Longer message explaining the details of the error"
}
}
}
},
"description": "Object to be thrown in case of an unsuccessful response"
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "roleassignmentId"
}
}
},
"204": {},
"412": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
}
]
}
},
"400": {
"body": {
"error": {
"code": "BadRequest",
"message": "Your request was badly formed please correct it and try again"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "raId"
}
}
},
"400": {
"body": {
"error": {
"code": "BadRequest",
"message": "Your request was badly formed please correct it and try again"
}
}
},
"404": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
}
]
}
},
"400": {
"body": {
"error": {
"code": "BadRequest",
"message": "Your request was badly formed please correct it and try again"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
}
]
}
},
"400": {
"body": {
"error": {
"code": "BadRequest",
"message": "Your request was badly formed please correct it and try again"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "roleassignmentId"
}
},
"400": {
"body": {
"error": {
"code": "BadRequest",
"message": "Your request was badly formed please correct it and try again"
}
}
},
"409": {
"body": {
"error": {
"code": "ConflictError",
"message": "the request could not be completed due to a conflict with the current state of the target resource"
}
}
}
}
}
18 changes: 16 additions & 2 deletions specification/authorization/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These are the global settings for the Authorization API.

``` yaml
openapi-type: arm
tag: package-2020-04-01-preview-only
tag: package-2020-04-preview
```

## Suppression
Expand Down Expand Up @@ -71,13 +71,27 @@ directive:

### Tag: package-2020-04-01-preview-only

These settings apply only when `--tag=package-2020-04-preview` is specified on the command line.
These settings apply only when `--tag=package-2020-04-01-preview-only` is specified on the command line.

``` yaml $(tag) == 'package-2020-04-01-preview-only'
input-file:
- Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json
```

### Tag: package-2020-04-preview

These settings apply only when `--tag=package-2020-04-preview` is specified on the command line.

``` yaml $(tag) == 'package-2020-04-preview'
input-file:
- Microsoft.Authorization/preview/2015-06-01/authorization-ClassicAdminCalls.json
- Microsoft.Authorization/stable/2015-07-01/authorization-ElevateAccessCalls.json
- Microsoft.Authorization/preview/2018-01-01-preview/authorization-ProviderOperationsCalls.json
- Microsoft.Authorization/preview/2018-01-01-preview/authorization-RoleDefinitionsCalls.json
- Microsoft.Authorization/preview/2018-07-01-preview/authorization-DenyAssignmentGetCalls.json
- Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json
```

### Tag: package-2015-07-01

These settings apply only when `--tag=package-2015-07-01` is specified on the command line.
Expand Down