[openstreetmap/openstreetmap-website] Add comment ids to changeset discussion api responses (PR #4245)

Anton Khorev notifications at github.com
Sun Sep 10 14:28:27 UTC 2023


When anything in the api returns comments, they don't have ids. This is probably because the comment ids were considered unimportant. There used to be no way to do anything with them. If you know a changeset id, you can ask the api to show this changeset, same for elements, users, notes, but not for comments.

But later changeset comment hide/unhide endpoints [were added](https://wiki.openstreetmap.org/wiki/API_v0.6#Hide_changeset_comment:_POST_/api/0.6/changeset/comment/#comment_id/hide). To use them you need to know comment ids. However there's no way to get the ids purely through the api. Currently the ids are attached to hide/unhide buttons in the web interface, with the web interface being the only way to get them.

Knowing the ids may help with scripted comment processing. For example, that name:ru vandal bombarded changeset discussions with hundreds of comments. For some users, when looking at the list of comments, you'll have to scroll through a ton of those useless comments before you find actual discussions. It would be nice to clean them up, which is easier to do when you don't have to parse comment ids out of web pages.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4245

-- Commit Summary --

  * Add comment ids to changeset discussion api responses

-- File Changes --

    M app/views/api/changesets/_changeset.json.jbuilder (1)
    M app/views/api/changesets/_changeset.xml.builder (1)
    M test/controllers/api/changesets_controller_test.rb (24)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4245.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4245.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4245
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4245 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230910/db872e25/attachment.htm>


More information about the rails-dev mailing list