<blockquote>
<p>there really ought to be a better solution and I was planning to do some investigation of the problem but it will require some serious deep diving in the rails code I suspect.</p>
</blockquote>
<p>Here are some of the challanges I was facing:</p>
<ul>
<li>Ensure backwards compatibility for clients sending broken Accept headers (i.e. JOSM).</li>
<li>Ensure backwards compatibility for clients that are not requesting any particular format (<em>/</em>)</li>
<li>In general, XML is always more important than JSON (also backwards compatibility)</li>
<li>Avoid large scale changes to existing unit tests (setting some default format on API level would not work)</li>
<li>URL Path suffix is more important than Accept header</li>
</ul>
<p>We have test cases covering all of those special cases.</p>
<p>I haven't found any approach to achieve those goals without additional logic outside of the Rails framework. People reported a few issues re. Accept header processing on the Rails repo. Hopefully those somewhat more fragile bits of the framework won't bite us anymore now.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications&email_token=AAK2OLNFLHIJ5YQQJLUCK4TRFDMN7A5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH5G5I#issuecomment-592434037">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLP3XAZIOVDBAPV65GTRFDMN7ANCNFSM4KAKS5KA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLOVCLKKQVV6V2A4FU3RFDMN7A5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH5G5I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications\u0026email_token=AAK2OLNFLHIJ5YQQJLUCK4TRFDMN7A5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH5G5I#issuecomment-592434037",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications\u0026email_token=AAK2OLNFLHIJ5YQQJLUCK4TRFDMN7A5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH5G5I#issuecomment-592434037",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>