Open MichaelsJP opened 1 year ago
The api also uses GeoJSON for requests. So, it might make sense to move it one level higher or to commons
, so it's available for requests and responses alike.
In general, I very much like the approach. This will also enhance the swagger documentation since it can give more detailed information when the objects are Jackson serializable and not just plain JSON objects being parsed :+1: .
As detailed, we could have a few PRs each migrating one endpoint, to not kill it with a single one.
Reduce the used JSON libraries to just
org.json.json/org.json.json-simple
andjackson
. Currently,org.json.json-simple
is used to serialize certain API responses, whereasorg.json.json
is also used in different situations.This should be replaced by clear POJOs with
jackson
annotations where possible (mostly in the API context, (de)serializing POJOs) and with a replacement of one of the JSON packages with the chosen one.I have no clear opinion towards one of the JSON packages.
Suggested Strategy
Those libraries are mostly used in generating Geo JSON responses. Cleaning it up will require to create a couple of more Geo JSON domain classes. Geo JSON classes are currently spread over different subpackages within
org.heigit.ors.api.responses
.Suggestion:
org.heigit.ors.api.responses.geojson
oderorg.heigit.ors.api.geojson
.Tasks
All tasks can be tackled in individual PRs.