Skip to content

Commit

Permalink
Merge "REST: Mark fallback label/description routes production ready"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Oct 11, 2024
2 parents 4ab7412 + fde1a89 commit 22aa60e
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 41 deletions.
7 changes: 6 additions & 1 deletion repo/rest-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# CHANGELOG {#wb_rest_api_changelog}

## Version TBD
## Version 0.5

* Added label/description endpoints with language fallback ([T371605](https://phabricator.wikimedia.org/T371605))
* `GET /entities/items/{item_id}/labels_with_language_fallback/{language_code}`
* `GET /entities/items/{item_id}/descriptions_with_language_fallback/{language_code}`
* `GET /entities/properties/{property_id}/labels_with_language_fallback/{language_code}`
* `GET /entities/properties/{property_id}/descriptions_with_language_fallback/{language_code}`
* Added `request-limit-reached` error for when a client makes too many edit requests ([T366594](https://phabricator.wikimedia.org/T366594))
* Added `permission-denied` error for unauthorized or prevented edits ([T366581](https://phabricator.wikimedia.org/T366581), [T330914](https://phabricator.wikimedia.org/T330914))
* Added `resource-too-large` error for edits that make a resource larger than the configured limit ([T330739](https://phabricator.wikimedia.org/T330739))
Expand Down
23 changes: 1 addition & 22 deletions repo/rest-api/routes.dev.json
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
[
{
"path": "/wikibase/v0/entities/items/{item_id}/labels_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemLabelWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/labels_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyLabelWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/items/{item_id}/descriptions_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemDescriptionWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/descriptions_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyDescriptionWithFallbackRouteHandler::factory"
}
]
[]
20 changes: 20 additions & 0 deletions repo/rest-api/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,21 @@
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemLabelRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/items/{item_id}/labels_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemLabelWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/labels/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyLabelRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/labels_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyLabelWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/items/{item_id}/labels/{language_code}",
"method": "PUT",
Expand Down Expand Up @@ -174,11 +184,21 @@
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemDescriptionRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/items/{item_id}/descriptions_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetItemDescriptionWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/descriptions/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyDescriptionRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/properties/{property_id}/descriptions_with_language_fallback/{language_code}",
"method": "GET",
"factory": "Wikibase\\Repo\\RestApi\\RouteHandlers\\GetPropertyDescriptionWithFallbackRouteHandler::factory"
},
{
"path": "/wikibase/v0/entities/items/{item_id}/descriptions/{language_code}",
"method": "PUT",
Expand Down
2 changes: 1 addition & 1 deletion repo/rest-api/specs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Wikibase REST API",
"version": "0.4",
"version": "0.5",
"description": "OpenAPI definition of Wikibase REST API",
"contact": {
"name": "Wikimedia Deutschland - Wikibase Product Platform Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"get": {
"operationId": "getItemDescriptionWithFallback",
"tags": [ "descriptions" ],
"summary": "[WIP] Retrieve an Item's description in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve an Item's description in a specific language, with language fallback",
"parameters": [
{ "$ref": "../../global/parameters.json#/ItemId" },
{ "$ref": "../../global/parameters.json#/LanguageCode" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"get": {
"operationId": "getPropertyDescriptionWithFallback",
"tags": [ "descriptions" ],
"summary": "[WIP] Retrieve a Property's description in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve a Property's description in a specific language, with language fallback",
"parameters": [
{ "$ref": "../../global/parameters.json#/PropertyId" },
{ "$ref": "../../global/parameters.json#/LanguageCode" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"get": {
"operationId": "getItemLabelWithFallback",
"tags": [ "labels" ],
"summary": "[WIP] Retrieve an Item's label in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve an Item's label in a specific language, with language fallback",
"parameters": [
{ "$ref": "../../global/parameters.json#/ItemId" },
{ "$ref": "../../global/parameters.json#/LanguageCode" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"get": {
"operationId": "getPropertyLabelWithFallback",
"tags": [ "labels" ],
"summary": "[WIP] Retrieve a Property's label in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve a Property's label in a specific language, with language fallback",
"parameters": [
{ "$ref": "../../global/parameters.json#/PropertyId" },
{ "$ref": "../../global/parameters.json#/LanguageCode" },
Expand Down
14 changes: 5 additions & 9 deletions repo/rest-api/src/RouteHandlers/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Wikibase REST API",
"version": "0.4",
"version": "0.5",
"description": "OpenAPI definition of Wikibase REST API",
"contact": {
"name": "Wikimedia Deutschland - Wikibase Product Platform Team",
Expand Down Expand Up @@ -1216,8 +1216,7 @@
"tags": [
"descriptions"
],
"summary": "[WIP] Retrieve an Item's description in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve an Item's description in a specific language, with language fallback",
"parameters": [
{
"$ref": "#/components/parameters/ItemId"
Expand Down Expand Up @@ -1450,8 +1449,7 @@
"tags": [
"descriptions"
],
"summary": "[WIP] Retrieve a Property's description in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve a Property's description in a specific language, with language fallback",
"parameters": [
{
"$ref": "#/components/parameters/PropertyId"
Expand Down Expand Up @@ -2442,8 +2440,7 @@
"tags": [
"labels"
],
"summary": "[WIP] Retrieve an Item's label in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve an Item's label in a specific language, with language fallback",
"parameters": [
{
"$ref": "#/components/parameters/ItemId"
Expand Down Expand Up @@ -2676,8 +2673,7 @@
"tags": [
"labels"
],
"summary": "[WIP] Retrieve a Property's label in a specific language, with language fallback",
"description": "This endpoint is currently in development and is not recommended for production use",
"summary": "Retrieve a Property's label in a specific language, with language fallback",
"parameters": [
{
"$ref": "#/components/parameters/PropertyId"
Expand Down

0 comments on commit 22aa60e

Please sign in to comment.