Skip to content

Commit

Permalink
REST: Add 429 response to OAS for edit routes
Browse files Browse the repository at this point in the history
Bug: T366594
Change-Id: Iafcc0edbc3039785adcdbb8f7000984d84d3bd5f
  • Loading branch information
jakobw committed Sep 23, 2024
1 parent 4f94c26 commit 31e243c
Show file tree
Hide file tree
Showing 24 changed files with 186 additions and 0 deletions.
25 changes: 25 additions & 0 deletions repo/rest-api/specs/global/responses.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,31 @@
}
}
},
"RequestLimitReached": {
"description": "Too many requests",
"content": {
"application/json": {
"schema": { "$ref": "./response-parts.json#/Error" },
"examples": {
"request-limit-reached": {
"value": {
"code": "request-limit-reached",
"message": "Exceeded the limit of actions that can be performed in a given span of time",
"context": { "reason": "{reason_code}" }
}
}
}
}
},
"headers": {
"Content-Language": {
"schema": {
"type": "string"
},
"description": "Language code of the language in which error message is provided"
}
}
},
"ResourceNotFound": {
"description": "The specified resource was not found",
"content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/aliases/list-for-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedAliases" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedAliases" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -76,6 +77,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -73,6 +74,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedDescriptions" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedDescriptions" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/items/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"400": { "$ref": "./responses.json#/InvalidNewItemInput" },
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/items/single.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedItem" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -76,6 +77,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -73,6 +74,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/labels/list-for-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedLabels" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedLabels" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/properties/single.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyPropertyPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedProperty" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/sitelinks/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyItemPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "./responses.json#/InvalidPatchedItemSitelinks" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
2 changes: 2 additions & 0 deletions repo/rest-api/specs/resources/sitelinks/single.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/DataPolicyViolation" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -75,6 +76,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"409": { "$ref": "../../global/responses.json#/ItemRedirected" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
3 changes: 3 additions & 0 deletions repo/rest-api/specs/resources/statements/single-for-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -65,6 +66,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyStatementPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedStatement" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -87,6 +89,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -65,6 +66,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyStatementPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedStatement" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -87,6 +89,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
3 changes: 3 additions & 0 deletions repo/rest-api/specs/resources/statements/single.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -62,6 +63,7 @@
"409": { "$ref": "../../global/responses.json#/CannotApplyStatementPatch" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"422": { "$ref": "../../global/responses.json#/InvalidPatchedStatement" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
},
Expand All @@ -83,6 +85,7 @@
"403": { "$ref": "../../global/responses.json#/PermissionDenied" },
"404": { "$ref": "../../global/responses.json#/ResourceNotFound" },
"412": { "$ref": "../../global/responses.json#/PreconditionFailedError" },
"429": { "$ref": "../../global/responses.json#/RequestLimitReached" },
"500": { "$ref": "../../global/responses.json#/UnexpectedError" }
}
}
Expand Down
Loading

0 comments on commit 31e243c

Please sign in to comment.