Skip to content

Commit 4ff784f

Browse files
jenkins-botGerrit Code Review
authored andcommitted
Merge "REST: Add permission-denied error to OAS for every edit route"
2 parents 7516193 + ff21415 commit 4ff784f

25 files changed

+194
-0
lines changed

repo/rest-api/specs/global/examples.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,15 @@
269269
"statement_property_id": "{property_id_value}"
270270
}
271271
}
272+
},
273+
"PermissionDeniedExample": {
274+
"value": {
275+
"code": "permission-denied",
276+
"message": "Access to resource is denied",
277+
"context": {
278+
"denial_reason": "{reason_code}",
279+
"denial_context": "{additional_context}"
280+
}
281+
}
272282
}
273283
}

repo/rest-api/specs/global/responses.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,25 @@
9494
}
9595
}
9696
},
97+
"PermissionDenied": {
98+
"description": "The access to resource was denied",
99+
"content": {
100+
"application/json": {
101+
"schema": { "$ref": "./response-parts.json#/Error" },
102+
"examples": {
103+
"permission-denied": { "$ref": "./examples.json#/PermissionDeniedExample" }
104+
}
105+
}
106+
},
107+
"headers": {
108+
"Content-Language": {
109+
"schema": {
110+
"type": "string"
111+
},
112+
"description": "Language code of the language in which error message is provided"
113+
}
114+
}
115+
},
97116
"ResourceNotFound": {
98117
"description": "The specified resource was not found",
99118
"content": {

repo/rest-api/specs/resources/aliases/aliases-in-language-for-item.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"304": { "$ref": "../../global/responses.json#/NotModified" },
4949
"400": { "$ref": "../../global/responses.json#/InvalidAddAliasesInput" },
50+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
5051
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
5152
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
5253
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

repo/rest-api/specs/resources/aliases/aliases-in-language-for-property.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
},
4747
"304": { "$ref": "../../global/responses.json#/NotModified" },
4848
"400": { "$ref": "../../global/responses.json#/InvalidAddAliasesInput" },
49+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
4950
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
5051
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
5152
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }

repo/rest-api/specs/resources/aliases/list-for-item.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"responses": {
3636
"200": { "$ref": "../../global/responses.json#/ItemAliases" },
3737
"400": { "$ref": "../../global/responses.json#/InvalidPatch" },
38+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
3839
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
3940
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
4041
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

repo/rest-api/specs/resources/aliases/list-for-property.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"responses": {
3535
"200": { "$ref": "../../global/responses.json#/PropertyAliases" },
3636
"400": { "$ref": "../../global/responses.json#/InvalidPatch" },
37+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
3738
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
3839
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
3940
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

repo/rest-api/specs/resources/descriptions/description-in-language-for-item.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"304": { "$ref": "../../global/responses.json#/NotModified" },
4949
"400": { "$ref": "../../global/responses.json#/InvalidSetDescriptionInput" },
50+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
5051
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
5152
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
5253
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
@@ -71,6 +72,7 @@
7172
"responses": {
7273
"200": { "$ref": "../../global/responses.json#/DescriptionDeleted" },
7374
"400": { "$ref": "../../global/responses.json#/InvalidRemoveDescriptionInput" },
75+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
7476
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
7577
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
7678
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

repo/rest-api/specs/resources/descriptions/description-in-language-for-property.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
},
4747
"304": { "$ref": "../../global/responses.json#/NotModified" },
4848
"400": { "$ref": "../../global/responses.json#/InvalidSetDescriptionInput" },
49+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
4950
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
5051
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
5152
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
@@ -69,6 +70,7 @@
6970
"responses": {
7071
"200": { "$ref": "../../global/responses.json#/DescriptionDeleted" },
7172
"400": { "$ref": "../../global/responses.json#/InvalidRemoveDescriptionInput" },
73+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
7274
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
7375
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
7476
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }

repo/rest-api/specs/resources/descriptions/list-for-item.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"responses": {
3939
"200": { "$ref": "../../global/responses.json#/ItemDescriptions" },
4040
"400": { "$ref": "../../global/responses.json#/InvalidPatch" },
41+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
4142
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
4243
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
4344
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

repo/rest-api/specs/resources/descriptions/list-for-property.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"responses": {
3838
"200": { "$ref": "../../global/responses.json#/PropertyDescriptions" },
3939
"400": { "$ref": "../../global/responses.json#/InvalidPatch" },
40+
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
4041
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
4142
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
4243
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },

0 commit comments

Comments
 (0)