[openstreetmap/openstreetmap-website] Add support for json traces API (PR #5943)
Harel M
notifications at github.com
Mon Apr 21 20:12:17 UTC 2025
### Description
This adds support for json for traces API (both for `index` and `show`).
This PR is to replace #5779.
To copy from the PR initial post there:
This PR adds JSON format support to the user's GPX files API endpoint, enhancing the API's flexibility and consistency with other endpoints that already support JSON responses. The implementation:
Adds JSON format handling to the traces controller (index, show)
Creates a JSON view template matching the XML structure
Ensures proper content type headers are set
This enhancement improves client-side parsing efficiency while maintaining backward compatibility with the existing XML format.
Resolves https://github.com/openstreetmap/openstreetmap-website/issues/5646
### How has this been tested?
Unfortunately, I was not able to test this.
Is there a more comprehensive guide as to how to setup a development environment? I've looked at what the CI does, mainly for the docker build and was able to boot up and instance, but I wasn't sure how I can create users there and if the mail stuff will work and how, so I was not able to test it properly.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5943
-- Commit Summary --
* Add support for json traces API
-- File Changes --
M app/controllers/api/traces_controller.rb (9)
M app/controllers/api/users/traces_controller.rb (5)
A app/views/api/traces/_trace.json.jbuilder (15)
A app/views/api/traces/show.json.jbuilder (3)
A app/views/api/users/traces/index.json.jbuilder (3)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5943.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5943.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5943
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5943 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250421/e05280cc/attachment-0001.htm>
More information about the rails-dev
mailing list