From fde1a8938ef5c7fb4da7ac64b2dbc3b102663713 Mon Sep 17 00:00:00 2001 From: Jakob Warkotsch Date: Wed, 9 Oct 2024 16:21:05 +0200 Subject: [PATCH] REST: Mark fallback label/description routes production ready Bug: T376365 Change-Id: Iadbc5dc107d34986c8b556af47b1050e9c0b9373 --- repo/rest-api/CHANGELOG.md | 7 +++++- repo/rest-api/routes.dev.json | 23 +------------------ repo/rest-api/routes.json | 20 ++++++++++++++++ repo/rest-api/specs/openapi.json | 2 +- .../description-with-fallback-for-item.json | 3 +-- ...escription-with-fallback-for-property.json | 3 +-- .../labels/label-with-fallback-for-item.json | 3 +-- .../label-with-fallback-for-property.json | 3 +-- repo/rest-api/src/RouteHandlers/openapi.json | 14 ++++------- 9 files changed, 37 insertions(+), 41 deletions(-) diff --git a/repo/rest-api/CHANGELOG.md b/repo/rest-api/CHANGELOG.md index 4bff7efb22c..d8cc1f2c885 100644 --- a/repo/rest-api/CHANGELOG.md +++ b/repo/rest-api/CHANGELOG.md @@ -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)) diff --git a/repo/rest-api/routes.dev.json b/repo/rest-api/routes.dev.json index 04841836dff..fe51488c706 100644 --- a/repo/rest-api/routes.dev.json +++ b/repo/rest-api/routes.dev.json @@ -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" - } -] +[] diff --git a/repo/rest-api/routes.json b/repo/rest-api/routes.json index 738ac391c58..e20e587c604 100644 --- a/repo/rest-api/routes.json +++ b/repo/rest-api/routes.json @@ -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", @@ -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", diff --git a/repo/rest-api/specs/openapi.json b/repo/rest-api/specs/openapi.json index 56f28788001..164dc279e28 100644 --- a/repo/rest-api/specs/openapi.json +++ b/repo/rest-api/specs/openapi.json @@ -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", diff --git a/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-item.json b/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-item.json index 3f6ea640375..98ce05edd75 100644 --- a/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-item.json +++ b/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-item.json @@ -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" }, diff --git a/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-property.json b/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-property.json index fa0388d9f0d..d098d1a9f41 100644 --- a/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-property.json +++ b/repo/rest-api/specs/resources/descriptions/description-with-fallback-for-property.json @@ -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" }, diff --git a/repo/rest-api/specs/resources/labels/label-with-fallback-for-item.json b/repo/rest-api/specs/resources/labels/label-with-fallback-for-item.json index ba32f5535e9..172f95e651d 100644 --- a/repo/rest-api/specs/resources/labels/label-with-fallback-for-item.json +++ b/repo/rest-api/specs/resources/labels/label-with-fallback-for-item.json @@ -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" }, diff --git a/repo/rest-api/specs/resources/labels/label-with-fallback-for-property.json b/repo/rest-api/specs/resources/labels/label-with-fallback-for-property.json index 006f28c4015..8c68a6c1108 100644 --- a/repo/rest-api/specs/resources/labels/label-with-fallback-for-property.json +++ b/repo/rest-api/specs/resources/labels/label-with-fallback-for-property.json @@ -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" }, diff --git a/repo/rest-api/src/RouteHandlers/openapi.json b/repo/rest-api/src/RouteHandlers/openapi.json index 0e08423ab13..6d739d032b0 100644 --- a/repo/rest-api/src/RouteHandlers/openapi.json +++ b/repo/rest-api/src/RouteHandlers/openapi.json @@ -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", @@ -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" @@ -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" @@ -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" @@ -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"