[openstreetmap/openstreetmap-website] JSON output added to changeset(s) endpoints (PR #3495)
Andy Allan
notifications at github.com
Mon Mar 14 11:52:47 UTC 2022
I think Option 2 is my preference. I mean, I gave a quick review of this PR and was about to question the whole Option 1 approach thing as being a bit weird, before realising it was what is done for nodes and ways already.
But on consideration, I think we made the wrong decision for nodes and ways. I think there's a difference between asking for an API call which might contain more than one node, but getting an array with only one node in it, versus asking for one specific object and getting an array back, which is unintuitive. I'd expect `get_changeset(1235)` to return a changeset, without having to do `get_changeset(1234).changesets.first` to get hold of it (and then having to wonder if empty arrays, or arrays with more than one object, could be valid responses). So my line of thinking is similar for the HTTP REST requests - if the client request is for one changeset, we should return a changeset object and not an array of changesets with one changeset inside.
I don't like Option 3 since it leads to namespace clashes e.g. on the version attribute, where objects can have a version as well as the response format having a version. The other document attributes are less likely to clash, but I still find it useful to separate them out.
Everything I write above is a bit subjective though so I'm not dead-set on anything.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3495#issuecomment-1066693808
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3495/c1066693808 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220314/c676510f/attachment.htm>
More information about the rails-dev
mailing list