[openstreetmap/openstreetmap-website] Allow setting JSON return type by HTTP ACCEPT header for notes API (PR #3714)
Robin Thomas
notifications at github.com
Fri Sep 23 09:55:44 UTC 2022
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.
I guess the routing tests (see example below) do not catch these cases because they do not allow to specify headers.
```
assert_routing(
{ :path => "/api/0.6/notes/1.json", :method => :get },
{ :controller => "api/notes", :action => "show", :id => "1", :format => "json" }
)
```
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/3714
-- Commit Summary --
* Allow setting HTTP ACCEPT header for notes API
-- File Changes --
M app/controllers/api/notes_controller.rb (1)
M config/routes.rb (2)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/3714.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3714.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3714
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3714 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220923/d1edf632/attachment-0001.htm>
More information about the rails-dev
mailing list