<p></p>
<p dir="auto">Someone proposed a Google Summer of Code project to <a href="https://wiki.openstreetmap.org/wiki/Google_Summer_of_Code/2022/Project_ideas#Core_.2F_API" rel="nofollow">add JSON support for all endpoints</a>. 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.</p>
<p dir="auto">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.</p>
<p dir="auto">As we don't have anyone who's interested in the task, the question at this time would be more along the lines of:</p>
<ul dir="auto">
<li>do we think this scope is feasible at all, too easy/difficult?</li>
<li>should we go for the 350 hours option?</li>
<li>is the list below somewhat complete, are there any topics missing?</li>
<li>our best guess time estimate for someone who has (a) nearly no Rails knowledge, (b) some limited idea, maybe attended a bootcamp or similar</li>
</ul>
<h3 dir="auto">Topic: OSM element upload</h3>
<p dir="auto">Relevant endpoints:</p>
<ul dir="auto">
<li>Diff upload: POST /api/0.6/changeset/#id/upload</li>
<li>Create: PUT /api/0.6/[node|way|relation]/create</li>
<li>Delete: DELETE /api/0.6/[node|way|relation]/#id</li>
<li>Update: PUT /api/0.6/[node|way|relation]/#id</li>
</ul>
<h3 dir="auto">Activities:</h3>
<h4 dir="auto">(1) Define new format specifications for JSON based messages:</h4>
<ul dir="auto">
<li>OSMChange, based on OSM JSON format</li>
<li>diffResult</li>
</ul>
<h4 dir="auto">(2) Extend existing models for nodes, ways, relations</h4>
<p dir="auto">app/models/node.rb<br>
app/models/way.rb<br>
app/models/relation.rb</p>
<ul dir="auto">
<li>Methods self.from_xml / self.from_xml_node<br>
-> implement something similar for JSON?<br>
-> refactor validation checks so that they could be reused across XML/JSON input formats?<br>
-> Error messages OSM::APIBadXMLError - new class?</li>
</ul>
<h4 dir="auto">(3) Extend API controllers</h4>
<p dir="auto">app/controllers/api/nodes_controller.rb<br>
app/controllers/api/ways_controller.rb<br>
app/controllers/api/relations_controller.rb</p>
<p dir="auto">-> Change create, update and delete methods to call JSON counterparts if needed</p>
<h4 dir="auto">(4) Implement diff upload w/ JSON support</h4>
<p dir="auto">lib/diff_reader.rb:</p>
<p dir="auto">-> extensive refactoring needed to support JSON</p>
<h4 dir="auto">(5) Extend changesets controller upload</h4>
<p dir="auto">app/controllers/api/changesets_controller.rb</p>
<p dir="auto">Use refactored diff reader in (4) to upload osmchange messages</p>
<h4 dir="auto">(6) Unit tests</h4>
<ul dir="auto">
<li>
<p dir="auto">test/controllers/api/changesets_controller_test.rb<br>
-> upload (handling both OSMChange in JSON format, as well as returning diffResult in JSON)</p>
</li>
<li>
<p dir="auto">test/controllers/api/nodes_controller_test.rb<br>
test/controllers/api/ways_controller_test.rb<br>
test/controllers/api/relations_controller_test.rb</p>
<p dir="auto">Implement tests for create, put and delete using JSON input</p>
</li>
</ul>
<hr>
<p dir="auto">// cc: <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/lonvia/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lonvia">@lonvia</a></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/issues/3501">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOOIYURKTMDCUM72YLU76VEZANCNFSM5QWZCZBQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMZYYDJGIBFRN5RXALU76VEZA5CNFSM5QWZCZB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4RNMLG6A.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/issues/3501</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/issues/3501",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3501",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>