<h3 dir="auto">Description</h3>
<p dir="auto">This adds support for json for traces API (both for <code class="notranslate">index</code> and <code class="notranslate">show</code>).<br>
This PR is to replace <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2904890281" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5779" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5779/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5779">#5779</a>.</p>
<p dir="auto">To copy from the PR initial post there:<br>
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:</p>
<p dir="auto">Adds JSON format handling to the traces controller (index, show)<br>
Creates a JSON view template matching the XML structure<br>
Ensures proper content type headers are set<br>
This enhancement improves client-side parsing efficiency while maintaining backward compatibility with the existing XML format.<br>
<span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #5646.">Resolves</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2843526758" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5646" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5646/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5646">#5646</a></p>
<h3 dir="auto">How has this been tested?</h3>
<p dir="auto">Unfortunately, I was not able to test this.</p>
<p dir="auto">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.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5943'>https://github.com/openstreetmap/openstreetmap-website/pull/5943</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/commits/7c055537b93648ad89a41892e5a6ff2fdb48cf1d" class="commit-link">7c05553</a>  Add support for json traces API</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files">5 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files#diff-e84777f55861eeb73fed3029e0429118ff087b7dd2314e398acadc4157dbaa05">app/controllers/api/traces_controller.rb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files#diff-9e84a5a560427679e0207f400191b13c846b2ed6f99dbd272c0130922bc5d848">app/controllers/api/users/traces_controller.rb</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files#diff-7af3a1a22929bc2c775d638b9002a0f5ea26b7a7e917460823dca3f5823abb19">app/views/api/traces/_trace.json.jbuilder</a>
    (15)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files#diff-25fcf0fa9b1318ab2fe239cac7ff57b7166825ee91ecd6f2249a95ceaf4a469a">app/views/api/traces/show.json.jbuilder</a>
    (3)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943/files#diff-6dd63ba68792653fd57c3e2dd791d00b153338604db2e968527eb4857eb79844">app/views/api/users/traces/index.json.jbuilder</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5943.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5943.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5943.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5943.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5943">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK6ZHW5HQVV3N5ZXLD22VGKDAVCNFSM6AAAAAB3R7L6LOVHI2DSMVQWIX3LMV43ASLTON2WKOZTGAYDSMRRGYYDSNY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLM4DYM4BOMMGZL2AAL22VGKDA5CNFSM6AAAAAB3R7L6LOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLGXH6ME.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5943</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5943",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5943",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>