iD icon indicating copy to clipboard operation
iD copied to clipboard

use JSON instead of XML for (almost) all OSM APIs

Open k-yle opened this issue 1 month ago • 0 comments

We can remove almost all the XML parsing code by using the OSM API's json endpoints. Deleted about 250 lines of code.

We already use the new JSON endpoints for most things. This PR migrates the last few endspoints:

  • GET /api/capabilities.json
  • GET /api/0.6/notes.json
  • GET /api/0.6/notes/{id}.json
  • POST /api/0.6/notes/{id}/{action}.json
  • GET /api/0.6/changesets.json

This is faster, simpler, and makes the code more concise.

The last remaining endpoint that doesn't support JSON is uploading changesets, which is tracked by https://github.com/openstreetmap/openstreetmap-website/pull/5973

affected parts of the UI:
  • in the changeset upload panel: the comment dropdown
  • view notes + view note comments
  • create note
  • close note
  • reopen note
  • comment on note
  • search for note by ID
  • (imageryBlocklist)
  • (max nodes per way)
  • API online/offline status

k-yle avatar Dec 10 '25 10:12 k-yle