[openstreetmap/openstreetmap-website] JSON output nodes, ways, relations, map (#2485)

Andy Allan notifications at github.com
Wed Jan 22 16:44:00 UTC 2020


gravitystorm commented on this pull request.



> +        if mime.symbol == :xml
+          request.format = "xml"
+          break
+        end
+
+        if mime.symbol == :json
+          request.format = "json"
+          break
+        end
+
+        # Any format, not explicitly requesting XML or JSON -> assume XML as default
+        if mime == "*/*"
+          request.format = "xml"
+          break
+        end
+      end

But this is a breaking change to the API, right? Now, if you request a resource with an Accept header of "text/plain" then you get the XML response. This PR would change that behaviour. That's why I discussed having the default being XML.

Of course, I would propose to fix this in API 0.7 and behave more sensibly wrt Accept headers in the new API version, but that will need to wait until there's progress with that topic.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2485#discussion_r369674625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200122/eaeba195/attachment-0001.htm>


More information about the rails-dev mailing list