Make the multi-get calls throw 400 errors on invalid input

Also refactor ways and relations to use the same structure as nodes
This commit is contained in:
Paul Norman 2013-08-03 03:20:46 -07:00 committed by Tom Hughes
parent ec9634d865
commit a1a5706203
3 changed files with 31 additions and 23 deletions

View file

@ -64,6 +64,10 @@ class NodeController < ApplicationController
# Dump the details on many nodes whose ids are given in the "nodes" parameter.
def nodes
if not params['nodes']
raise OSM::APIBadUserInput.new("The parameter nodes is required, and must be of the form nodes=id[,id[,id...]]")
end
ids = params['nodes'].split(',').collect { |n| n.to_i }
if ids.length == 0