[OSM-dev] PUT /api/0.6/{node|way|relation}/{id|create}

Stefan de Konink skinkie at xs4all.nl
Mon Jun 9 20:26:40 BST 2008


Dave Stubbs schreef:
> On Mon, Jun 9, 2008 at 6:47 PM, Stefan de Konink <skinkie at xs4all.nl> wrote:
>> Dave Stubbs schreef:
>>> I think it has been solved: just implement the API the way it is.
>> That is the actual question. Why does the api require a {node|way|relation}
>> if the actual XML, first child, already gives this information?
> 
> 
> Because it lets you easily route the request to the relevant piece of
> server code without having to parse the (potentially large) payload
> first.
 >
> ie: http://trac.openstreetmap.org/browser/sites/rails_port/config/routes.rb
> 
> which dispatches the API commands to the relevant rails controller and
> action to handle the request.
> 
> It is of course possible to do it without that. YMMV on whether this
> gains or loses much, but it changes the API quite a lot in the process
> which is probably a bad thing without a clear cut gain.

The payload should be validated anyhow. And going to the 'first' child 
is an operation that should happen too.

So if this is only because 'rails needs it' I hope the C++ guys or my 
code can replace this ugly duplication soon.



Stefan




More information about the dev mailing list