<p>This PR uses an xml builder template to create the API capabilities response, rather than building the xml response 'by hand' in the controller. This makes the code easier to read, as well as more closely following the MVC conventions.</p>
<p>It also refactors the other builder-based XML responses to use the same set of root attributes (i.e. adding copyright, attribution and license attributes) as the other XML responses.</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/2108'>https://github.com/openstreetmap/openstreetmap-website/pull/2108</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Use full list of osm xml root attributes in builder templates</li>
  <li>Use a builder view for the capabilities call</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-0">app/controllers/api_controller.rb</a>
    (45)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-1">app/views/api/capabilities.builder</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-2">app/views/api/permissions.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-3">app/views/notes/index.xml.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-4">app/views/notes/show.xml.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-5">app/views/users/api_read.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-6">app/views/users/api_users.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2108/files#diff-7">lib/osm.rb</a>
    (16)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2108.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2108.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2108.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2108.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/2108">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLQCuoXD7cC8Q7X6iBR8xduuTIV4fks5vBfk4gaJpZM4Z3kJq">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLRmftC0VhKbc2sJrhGvOs30gr9Usks5vBfk4gaJpZM4Z3kJq.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Use an xml builder to generate the capabilities response (#2108)"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/2108"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2108",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2108",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>