[openstreetmap/openstreetmap-website] Add support for json traces API (PR #5943)

Marwin Hochfelsner notifications at github.com
Wed Apr 23 22:18:18 UTC 2025


@hlfan approved this pull request.

Looks good, only noted some minor ideas

> +      if @trace.public? || @trace.user == current_user
+        respond_to do |format|
+          format.xml
+          format.json
+        end
+      else
+        head :forbidden
+      end

```suggestion
      return head :forbidden unless @trace.public? || @trace.user == current_user

      respond_to do |format|
        format.xml
        format.json
      end
```
I'd keep the `head :forbidden unless` guard clause from before

> +        assert_equal trace1.id, js["traces"][0]["id"]
+        assert_equal trace2.id, js["traces"][1]["id"]

I'd like to see the tags being checked like for the XML here too

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

Message ID: <openstreetmap/openstreetmap-website/pull/5943/review/2788783045 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250423/597a8aeb/attachment.htm>


More information about the rails-dev mailing list