If the request contains id in the statement data, the API should respond with 400 (error code: invalid-operation-change-statement-id, error message: Cannot change the ID of the existing statement) unless the provided ID matches the the statement's ID in the request's path
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Ifrahkhanyaree_WMDE | T344228 Functionality for REST API v1 | |||
Resolved | None | T306936 🟫 Replace item statement | |||
Resolved | Ollie.Shotton_WMDE | T314790 🟫 Reject statements that change the Statement ID |
Event Timeline
Change 821701 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):
[mediawiki/extensions/Wikibase@master] REST: Reject statements that change Statement ID
Change 821704 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):
[mediawiki/extensions/Wikibase@master] REST: Reject statements that change Statement ID
Change 821701 abandoned by Ollie Shotton:
[mediawiki/extensions/Wikibase@master] REST: Reject statements that change Statement ID
Reason:
Abandoning in favour of I4552a8f62608f1fcb482a1eeb8875563278c77cd
Change 821704 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] REST: Reject statements that change Statement ID
Ended up doing use case validation as the alternative of catching exceptions thrown by the Data Model didn’t feel “right”.
We could raise an error in the Data Model as well as use case validation for a belt and braces approach; probably depends on how/where StatementList::replaceStatement() will be used in the future.
Change 825826 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):
[mediawiki/extensions/Wikibase@master] DM: Differentiate `replaceStatement()` exceptions
Change 825827 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):
[mediawiki/extensions/Wikibase@master] REST: Refactor Statement ID changed validation
Change 825826 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] DM: Differentiate `replaceStatement()` exceptions
Change 825827 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] REST: Refactor Statement ID changed validation