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

mmd notifications at github.com
Fri Feb 28 09:46:07 UTC 2020

> 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.

Here are some of the challanges I was facing:
- Ensure backwards compatibility for clients sending broken Accept headers (i.e. JOSM). 
- Ensure backwards compatibility for clients that are not requesting any particular format (*/*)
- In general, XML is always more important than JSON (also backwards compatibility)
- Avoid large scale changes to existing unit tests (setting some default format on API level would not work)
- URL Path suffix is more important than Accept header

We have test cases covering all of those special cases.

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.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200228/fbfacbfd/attachment.htm>

More information about the rails-dev mailing list