### 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/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to