Page MenuHomePhabricator

🥣️Add the type field to statement serialization
Closed, ResolvedPublic

Description

POST, PUT and PATCH for statements do not require the "type" field to be provided in the request. It therefore needs to be added to the serialisation for internal use:

  • in a separate patch, first rename Wikibase\Repo\RestApi\Domain\Serializers to Wikibase\Repo\RestApi\Domain\Serialization
  • inside that namespace, create a wrapper around the existing StatementDeserializer, which adds the 'type' => 'statement' field
  • use the newly created wrapped Deserializer in JsonDiffStatementPatcher and SnakValidatorStatementValidator
  • remove type fields from all statement serializations in unit, e2e and schema tests

Event Timeline

Change 832618 had a related patch set uploaded (by Silvan Heintze; author: Ollie Shotton):

[mediawiki/extensions/Wikibase@master] REST: Add 'type' field to Statement serialization

https://gerrit.wikimedia.org/r/832618

Change 832618 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Don't require 'type' field in Statement serialization

https://gerrit.wikimedia.org/r/832618