Closed lucaswerkmeister closed 3 years ago
We pass the
PropertyDataTypeLookup
into theMinimalItemInput
constructor, but apart from that the item input constructors still get their services from the defaultWikibaseRepo
instance. I assume we’ll turn these into services of their own later.
@toban I’d say that’s part of https://phabricator.wikimedia.org/T282243? :)
Wait a second. We’re only injecting our fake property datatype lookup into EditEndpoint
, not into Wikibase itself… why can the item still be saved successfully?
I guess EditEntity
gets an already deserialized entity and just assumes that all the referenced entities also exist… in normal API usage, an error that a property can’t be found would’ve been thrown at an earlier point, so it’s not EditEntity
’s responsibility? And that’s why it works?
On REL1_35, they’re not yet available in the MediaWiki service container, but getting them in the
factory()
method and injecting them into the constructor is still better than getting them in therun()
method. One thing this lets us do is inject a fake property datatype lookup in the test, which is probably more efficient than creating and saving a real property.We pass the
PropertyDataTypeLookup
into theMinimalItemInput
constructor, but apart from that the item input constructors still get their services from the defaultWikibaseRepo
instance. I assume we’ll turn these into services of their own later.Bug: T282244