Page MenuHomePhabricator

Why are qualifiers and references updated via POST?
Closed, ResolvedPublic

Description

Most resources in the proposed spec are replaced with PUT and updated with PATCH. However, qualifiers and references are updated using POST, which otherwise is reserved for creating new resources. Is that intentional? If it is, maybe it the underlying reasons should be documented somewhere, since they aren't immediately obvious.

Event Timeline

I was going to write that e.g. POST ​/statements​/{statement_id}​/qualifiers, which in my understanding is a collection to which the request adds an object, and that this fits my understanding of the purpose of POST but now realize that this is probably about e.g. /statements/{statement_id}/qualifiers/{qualifier_hash}...

And for that I don't have an answer, not even a suspicion at the moment.

My thinking here is that this has to do with the fact that you are always creating a newly addressable resource when updating qualifiers or references, as the hash will change.

you are always creating a newly addressable resource when updating qualifiers or references

I'm understanding this as "the hash changes through the update"? Yes, the name sort of implies that I just somewhat considered that a misnomer.
Makes you wonder if the hash is then really a good choice for an identifying criterion in an URI...

We decided to write a Gotchas document in the git repo that coveres the reasoning and possible confusions that the status quo here might cause people

Will try and document this "gotcha" and that it may come up again in the future.

Addshore moved this task from Peer review to Done on the Wikibase REST API Schema board.