<p><b>@mmd-osm</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2353#discussion_r319453220">test/controllers/api/capabilities_controller_test.rb</a>:</p>
<pre style='color:#555'>> @@ -7,27 +7,54 @@ class CapabilitiesControllerTest < ActionController::TestCase
def test_routes
assert_routing(
{ :path => "/api/capabilities", :method => :get },
- { :controller => "api/capabilities", :action => "show" }
+ { :controller => "api/v06/capabilities", :action => "show", :api_version => "0.6" }
</pre>
<p>Say we want to use semantic versioning like 1.2.0, how would this be reflected specifically in directory names like <code>v06</code>?</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2353#discussion_r319453779">app/assets/javascripts/osm.js.erb</a>:</p>
<pre style='color:#555'>> @@ -10,7 +10,7 @@ OSM = {
MAX_REQUEST_AREA: <%= Settings.max_request_area.to_json %>,
SERVER_PROTOCOL: <%= Settings.server_protocol.to_json %>,
SERVER_URL: <%= Settings.server_url.to_json %>,
- API_VERSION: <%= Settings.api_version.to_json %>,
+ API_VERSION: <%= Settings.api_versions.min_by(&:to_f).to_json %>,
</pre>
<p>Why is this value set to "min_by", and what are the implications of it? Does <code>&:to_f</code> play nice with semver (e.g. 1.2.0)?</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2353#discussion_r319455091">config/routes.rb</a>:</p>
<pre style='color:#555'>> @@ -1,24 +1,58 @@
OpenStreetMap::Application.routes.draw do
+ # Our api versions are decimals, but controllers cannot start with a number
+ # or contain punctuation
+ def v_string(version)
+ "v#{version.delete('.')}"
</pre>
<p>Thinking of semver again, would it be better to replace "." by "_" maybe, so it's <code>v0_7 </code> and <code>v1_2 </code>? How about patch version number? Ignore or include?</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2353#discussion_r319456250">test/controllers/api/changesets_controller_test.rb</a>:</p>
<pre style='color:#555'>> - <member type='relation' role='some' ref='#{relation.id}'/>
- </relation>
- </create>
- </osmChange>
+ all_api_versions.each do |api_version|
+ user = create(:user)
+ changeset = create(:changeset, :user => user)
+ node = create(:node)
+ way = create(:way_with_nodes, :nodes_count => 2)
+ relation = create(:relation)
+
+ basic_authorization user.email, "test"
+
+ # simple diff to create a node way and relation using placeholders
+ diff = <<CHANGESET.strip_heredoc
+ <osmChange>
</pre>
<p>At one point we'd also need to include a version number in <code><osmChange></code> (maybe not now)</p>
<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/2353?email_source=notifications&email_token=AAK2OLLBFNRPKFQZSZAFYG3QHD2GBA5CNFSM4IOIASA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDHEJRA#pullrequestreview-281953476">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPYXHTC5NW6WYRSCULQHD2GBANCNFSM4IOIASAQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLJ4EEB3KPT2O63VFJ3QHD2GBA5CNFSM4IOIASA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDHEJRA.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/2353?email_source=notifications\u0026email_token=AAK2OLLBFNRPKFQZSZAFYG3QHD2GBA5CNFSM4IOIASA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDHEJRA#pullrequestreview-281953476",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2353?email_source=notifications\u0026email_token=AAK2OLLBFNRPKFQZSZAFYG3QHD2GBA5CNFSM4IOIASA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDHEJRA#pullrequestreview-281953476",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>