<p dir="auto">Currently the notes API json return type can only be specified by appending the .json file extension at the end of the URL path. This is inconsistent to other JSON API entry points which also allow specifying the return type via the HTTP ACCEPT header.</p>
<p dir="auto">I guess the routing tests (see example below) do not catch these cases because they do not allow to specify headers.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" assert_routing(
{ :path => "/api/0.6/notes/1.json", :method => :get },
{ :controller => "api/notes", :action => "show", :id => "1", :format => "json" }
)"><pre class="notranslate"><code> assert_routing(
{ :path => "/api/0.6/notes/1.json", :method => :get },
{ :controller => "api/notes", :action => "show", :id => "1", :format => "json" }
)
</code></pre></div>
<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/3714'>https://github.com/openstreetmap/openstreetmap-website/pull/3714</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3714/commits/ed1112bcef8598f30d90dfaa382a258156d8e457" class="commit-link">ed1112b</a> Allow setting HTTP ACCEPT header for notes 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/3714/files">2 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3714/files#diff-6e9fe051c0ef757618e376ffe731dfca8d4960ef0838b7d6a05609b46ba0fad1">app/controllers/api/notes_controller.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3714/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(2)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3714.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3714.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3714.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3714.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/3714">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOOOTDIJM46BAIHLV3V7V5CBANCNFSM6AAAAAAQT2MYVY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPPPQYOCSZUIVLXAQDV7V5CBA5CNFSM6AAAAAAQT2MYV2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFE535NM.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/3714</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/3714",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3714",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>