Description:
As a tool developer I want to be able to remove old or wrong information in a given language on a property's label
DELETE /entities/properties/{property_id}/labels/{lang_code}
Acceptance criteria:
- On the successful removal, API should respond with 200 and "label deleted" as a response body.
- 200 response should also contain Content-Language header with "en" as a value
- Following error cases have to be considered:
HTTP response code | response payload | |
---|---|---|
Property does not exist | 404 | "code": "property-not-found" "message": "Could not find a property with the ID: {property_id}" |
Invalid property ID | 400 | "code": "invalid-property-id" "message": "Not a valid property ID: <PROPERTY_ID>" |
Invalid language code | 400 | "code": "invalid-language-code" "message": "Not a valid language code : <language code>" |
Property does not have label in given language | 404 | "code": "label-not-defined" "message": "Property with the ID <property_id> does not have a label in the language: <language_code>" |
Invalid edit tag | 400 | { "code": "invalid-edit-tag", "message": "Invalid MediaWiki tag: {tag}" } |
Comment too long | 400 | {"code": "comment-too-long", "message": "Comment must not be longer than {limit} characters"} |
Notes:
- "Automated edit summary" related to the edit to be of form: /* wbsetlabel-remove:1|LANG */ LABEL
- client can provide additional edit metadata: mediawiki tags, edit summary text to append to the automated summary, and a bot edit flag, like in DELETE /entities/items/{item_id}/statements/{statement_id}
- Allow empty request body.
- Handle HTTP conditional request headers as in DELETE /entities/item/{item_id}/statements/{statement_id}
- Handle user authentication/authorization like in DELETE /entities/items/{item_id}/statements/{statement_id}
Task breakdown notes:
- Add the new route to OAS.
- happy path (including the edit summary)
ETag and Last-Modified
- Implement use case validation and deserialization
- Respond 404 if property not found or property does not have a label in the requested language
- Authorization
- Use the usual middlewares and add the route handler to RouteHandlersTest
- Add spec tests.
- Mark as production ready.