-
Improvement
-
Resolution: Done
-
Normal
-
None
-
None
Currently the webservice will return <direction>backward</direction> if the relationship between the requested item and the item in the relation list is backwards. However, there's no equivalent attribute returned for forward relationships. This means that checking for a relationship requires you to first check if the key exists (if so, it's forwards), otherwise if it exists and says backward, then it's backwards. This is especially problematic in python, where we try and do rel["direction"], which will raise a KeyError if the attribute doesn't exist. mr_monkey mentioned a similar situation in the BB API with javascript.
We proposed adding this attribute always, and having it show forward for forwards relationships. This should be a backwards compatible change, however there may be people who only check for the presence of the <direction> tag to determine if it's a backwards relationship and don't actually check the value.
Discussion: https://chatlogs.metabrainz.org/brainzbot/metabrainz/2019-09-16/?msg=4456957&page=2