[openstreetmap/openstreetmap-website] GSoC project: JSON support for some API endpoints (element upload) (Issue #3501)
mmd
notifications at github.com
Mon Mar 14 21:25:32 UTC 2022
Someone proposed a Google Summer of Code project to [add JSON support for all endpoints](https://wiki.openstreetmap.org/wiki/Google_Summer_of_Code/2022/Project_ideas#Core_.2F_API). While this huge task probably won't fit nicely in an 175 hours timeframe, it might be a good idea to identify smaller subsets of the task, which might be feasible, at least in theory.
The purpose of this issue is to identify one such a smaller subset, and outline the relevant scope to create, modify and delete objects using JSON format, either as single object operation, or using the diff upload.
As we don't have anyone who's interested in the task, the question at this time would be more along the lines of:
* do we think this scope is feasible at all, too easy/difficult?
* should we go for the 350 hours option?
* is the list below somewhat complete, are there any topics missing?
* our best guess time estimate for someone who has (a) nearly no Rails knowledge, (b) some limited idea, maybe attended a bootcamp or similar
### Topic: OSM element upload
Relevant endpoints:
- Diff upload: POST /api/0.6/changeset/#id/upload
- Create: PUT /api/0.6/[node|way|relation]/create
- Delete: DELETE /api/0.6/[node|way|relation]/#id
- Update: PUT /api/0.6/[node|way|relation]/#id
### Activities:
#### (1) Define new format specifications for JSON based messages:
- OSMChange, based on OSM JSON format
- diffResult
#### (2) Extend existing models for nodes, ways, relations
app/models/node.rb
app/models/way.rb
app/models/relation.rb
* Methods self.from_xml / self.from_xml_node
-> implement something similar for JSON?
-> refactor validation checks so that they could be reused across XML/JSON input formats?
-> Error messages OSM::APIBadXMLError - new class?
#### (3) Extend API controllers
app/controllers/api/nodes_controller.rb
app/controllers/api/ways_controller.rb
app/controllers/api/relations_controller.rb
-> Change create, update and delete methods to call JSON counterparts if needed
#### (4) Implement diff upload w/ JSON support
lib/diff_reader.rb:
-> extensive refactoring needed to support JSON
#### (5) Extend changesets controller upload
app/controllers/api/changesets_controller.rb
Use refactored diff reader in (4) to upload osmchange messages
#### (6) Unit tests
- test/controllers/api/changesets_controller_test.rb
-> upload (handling both OSMChange in JSON format, as well as returning diffResult in JSON)
- test/controllers/api/nodes_controller_test.rb
test/controllers/api/ways_controller_test.rb
test/controllers/api/relations_controller_test.rb
Implement tests for create, put and delete using JSON input
---
// cc: @lonvia
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3501
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3501 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220314/4937a2d5/attachment-0001.htm>
More information about the rails-dev
mailing list