<p>As the issue title suggests, this is still very much WIP with the intention to gather some early feedback, go through a number of iterations to fix issues, etc.</p>
<p>Topics in this PR:</p>
<p>(1) Move the XML generation from the controller to the view for the following controllers:</p>
<ul>
<li>nodes_controller</li>
<li>ways_controller</li>
<li>relations_controller</li>
<li>map_controller</li>
</ul>
<p>(2) Adding JSON output according to the Overpass API JSON format spec for nodes, ways, relations, and the map call.</p>
<p>TODO:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Remove XML generation methods in models</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Finish off remaining methods in all four controllers</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Test cases</li>
</ul>
<p>Follow up for <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="201017167" data-permission-text="Issue title is private" data-url="https://github.com/openstreetmap/iD/issues/3765" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/iD/issues/3765/hovercard" href="https://github.com/openstreetmap/iD/issues/3765">openstreetmap/iD#3765</a></p>
<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/2221'>https://github.com/openstreetmap/openstreetmap-website/pull/2221</a></p>
<h4>Commit Summary</h4>
<ul>
<li>nodes,ways,relations xml/json prototype</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-0">app/controllers/api/map_controller.rb</a>
(20)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-1">app/controllers/api/nodes_controller.rb</a>
(18)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-2">app/controllers/api/relations_controller.rb</a>
(18)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-3">app/controllers/api/ways_controller.rb</a>
(27)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-4">app/views/api/map/_bounds.xml.builder</a>
(8)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-5">app/views/api/map/_node.json.jsonify</a>
(19)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-6">app/views/api/map/_node.xml.builder</a>
(25)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-7">app/views/api/map/_relation.json.jsonify</a>
(24)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-8">app/views/api/map/_relation.xml.builder</a>
(20)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-9">app/views/api/map/_way.json.jsonify</a>
(17)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-10">app/views/api/map/_way.xml.builder</a>
(20)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-11">app/views/api/map/index.json.jsonify</a>
(22)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-12">app/views/api/map/index.xml.builder</a>
(8)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-13">app/views/api/nodes/index.json.jsonify</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-14">app/views/api/nodes/index.xml.builder</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-15">app/views/api/relations/index.json.jsonify</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-16">app/views/api/relations/index.xml.builder</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-17">app/views/api/ways/index.json.jsonify</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-18">app/views/api/ways/index.xml.builder</a>
(5)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2221/files#diff-19">config/routes.rb</a>
(20)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2221.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2221.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2221.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2221.diff</a></li>
</ul>
<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/2221">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMDZROJNJ2CUQD6XI3PT4QMVANCNFSM4HK325VQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLLYXKMHH7JSHUH3C63PT4QMVA5CNFSM4HK325V2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GSBDDAQ.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/2221",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2221",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>