<p></p>
<p><b>@gravitystorm</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4605#discussion_r1619323343">config/routes.rb</a>:</p>
<pre style='color:#555'>> @@ -78,6 +78,15 @@
       end
     end
 
+    resources :messages, :path => "user/messages", :constraints => { :id => /\d+/ }, :only => [:create, :show, :destroy], :controller => "messages", :as => :api_messages do
</pre>
<p dir="auto">In general I would not recommend any nesting. I would only add the nesting if either:</p>
<ul dir="auto">
<li>There's a need for the id of the parent object (e.g. /node/:id/relations), or</li>
<li>There's a need to disambiguate between two same-named controllers (e.g. the classic <code class="notranslate">/admin/users/</code>)</li>
</ul>
<p dir="auto">However, in this particular case, I support <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/milan-cvetkovic/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/milan-cvetkovic">@milan-cvetkovic</a> , since it actually matches our existing API. As far as I can tell, almost every existing call where the responses are specific to the current user (and don't refer to public objects) are nested under <code class="notranslate">/user</code>:</p>
<ul dir="auto">
<li>/api/0.6/user/details</li>
<li>/api/0.6/user/gpx_files</li>
<li>/api/0.6/user/preferences</li>
</ul>
<p dir="auto">However some are not:</p>
<ul dir="auto">
<li>/api/0.6/permissions</li>
</ul>
<p dir="auto">(There are other calls where it's a user-specific action on an otherwise public object, like subscribing to a changeset, but I treat these as a different situation than the above).</p>
<p dir="auto">So I think we should add the nesting for messages too, purely for consistency, even though I don't like it!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4605#discussion_r1619323343">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ5SVV5IMUKYMPHGHDZEYNZJAVCNFSM6AAAAABFBAKSFGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAOBWGE2DANBTGA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMSZGCOXLYFPA63HI3ZEYNZJA5CNFSM6AAAAABFBAKSFGWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTT4K75A4.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4605/review/2086140430</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4605#discussion_r1619323343",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4605#discussion_r1619323343",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>