Description:
The statement ID contains the ID of the item or the property which is the "subject" of the statement. If the ID of the "subject" and the ID of the item and property provided in the request path do not match, the input is clearly invalid and it is clear that the Wikibase REST API will not be able to process the request and the API can early stop processing the request.
Acceptance criteria:
Suggested response: 400 error response
"code": "item-statement-id-mismatch" / "property-statement-id-mismatch" "message": "IDs of the item and the statement do not match" / "IDs of the property and the statement do not match" "context": { "item-id": "<ITEM_ID>", "statement-id": "<STATEMENT_ID>" } / { "property-id": "<PROPERTY_ID>", "statement-id": "<STATEMENT_ID>" }
Notes:
Endpoints this refers to:
- GET, PUT, DELETE, PATCH /entities/items/{item_id}/statements/{statement_id}
- GET, PUT, DELETE, PATCH /entities/properties/{property_id}/statements/{statement_id}
Task breakdown notes:
- create two request interfaces that combine StatementIdRequest with ItemIdRequest and PropertyIdRequest respectively
- create a new validator for these kinds of requests that checks the IDs
- remove the corresponding checks from the wrapper use cases
- e2e tests