API JSON output
This commit is contained in:
parent
0db30c611a
commit
75a49786f8
34 changed files with 350 additions and 13 deletions
13
app/views/api/ways/_way.json.jbuilder
Normal file
13
app/views/api/ways/_way.json.jbuilder
Normal file
|
@ -0,0 +1,13 @@
|
|||
json.type "way"
|
||||
json.id way.id
|
||||
json.timestamp way.timestamp.xmlschema
|
||||
json.version way.version
|
||||
json.changeset way.changeset_id
|
||||
json.user way.changeset.user.display_name
|
||||
json.uid way.changeset.user_id
|
||||
|
||||
json.visible way.visible unless way.visible
|
||||
|
||||
json.nodes way.nodes.ids unless way.nodes.ids.empty?
|
||||
|
||||
json.tags way.tags unless way.tags.empty?
|
7
app/views/api/ways/full.json.jbuilder
Normal file
7
app/views/api/ways/full.json.jbuilder
Normal file
|
@ -0,0 +1,7 @@
|
|||
json.partial! "api/map/root_attributes"
|
||||
|
||||
all = @nodes + [@way]
|
||||
|
||||
json.elements(all) do |obj|
|
||||
json.partial! obj
|
||||
end
|
5
app/views/api/ways/index.json.jbuilder
Normal file
5
app/views/api/ways/index.json.jbuilder
Normal file
|
@ -0,0 +1,5 @@
|
|||
json.partial! "api/map/root_attributes"
|
||||
|
||||
json.elements(@ways) do |way|
|
||||
json.partial! way
|
||||
end
|
5
app/views/api/ways/show.json.jbuilder
Normal file
5
app/views/api/ways/show.json.jbuilder
Normal file
|
@ -0,0 +1,5 @@
|
|||
json.partial! "api/map/root_attributes"
|
||||
|
||||
json.elements([@way]) do |way|
|
||||
json.partial! way
|
||||
end
|
5
app/views/api/ways/ways_for_node.json.jbuilder
Normal file
5
app/views/api/ways/ways_for_node.json.jbuilder
Normal file
|
@ -0,0 +1,5 @@
|
|||
json.partial! "api/map/root_attributes"
|
||||
|
||||
json.elements(@ways) do |way|
|
||||
json.partial! way
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue