-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiplatform OSM API client #5410
Comments
I would like to pick this up. I will ping back after some basic implementation. |
This is blocked by #5408, i.e. that should be done first. |
Because, the thinking is the following:
|
My intention is to build an equivalent of de.westnordost.osmapi so that it can be used in multiplatform. Using Ktor client seems a viable option and that can be extended for other API calls within the project. I understand that the maintenance will take its toll but I beleive Ktor is here to stay. Only caveat we found was with the deserialization of xml. Though ktor provides a library, its only JVM compatible. With io.github.pdvrieze.xmlutil, I think it makes a better sense. Let me know if we have decided on HTTP Client |
Cool! Indeed. Yes, xmlutil should work. The only http client that is multiplatform also for native is Ktor Client, as far as I know, so the decision is to use Ktor. OkHttp 5 is only multiplatform jvm+js. |
@westnordost we started off simple in an independent repository. I gave you read access. We can move it to any other repo once its in a decent shape |
I can have a look at it when it is public, if you like, though bear in mind that I have zero experience with Ktor Client so far. The OSM API on the other hand I know inside-out. |
We have come to a decent shape on the api. We may need help in how to publish it for using in other projects. This may be a bit tricky. |
Not sure what you mean. Java/Kotlin FOSS libraries are generally published on maven central via sonatype. If you are not sure what to write into the build gradle, I recently published a multiplatform library too, check https://github.com/westnordost/osm-opening-hours/blob/master/build.gradle.kts If it is regarding the license: Any open source license would do, permissive or LGPL, even GPLv3 would be fine. |
The code is almost ready to be made public. @westnordost need advice on the package name though. right now its |
in.susrisha.osmapi ?
Or, com.<nameofyourcompany>.osmapi?
El 16 de febrero de 2024 11:36:44 CET, Naresh Kumar D ***@***.***> escribió:
…The code is almost ready to be made public. @westnordost need advice on the package name though. right now its `com.example.osmapi` . What do you suggest?
--
Reply to this email directly or view it on GitHub:
#5410 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Its hosted under vindago org. So, we will name it com.vindago.osmapi Thanks for the suggestion |
In that case, in.vindago.osmapi would be more correct (as you don't own vindago.com)
El 16 de febrero de 2024 12:30:24 CET, Naresh Kumar D ***@***.***> escribió:
…Its hosted under vindago org. So, we will name it com.vindago.osmapi Thanks for the suggestion
--
Reply to this email directly or view it on GitHub:
#5410 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
@westnordost here is the public link to the API library. its not complete yet but its a start. https://github.com/vindagollc/osm-api/ |
Ah, cool, interesting! This is actually a fork/port of the Java library, so this clears the license question, it must be licensed under the identical license as the java library. Would you add the license information, too? I can have a more thorough look through it later. Do you prefer I create issues for everything I find, or rather one issue in which I bundle the "review". Or some other method? It would be nice if there was a way where I could easily comment on and make suggestions on single lines. Maybe make a PR from master to a new empty branch that does not contain anything yet, so everything is a diff? From a cursory look, it looks quite complete already! I haven't looked at the code in detail, and there seem to be still some open TODOs / WIP, but the overall structure looks good! That must have been quite a lot of work! Some thoughts:
|
Requires #5408 to be done first.
The OSM API is a HTTP REST API that communicates chiefly in XML. This must be ported to Kotlin multiplatform.
Currently, the Java library
de.westnordost.osmapi
is used for any communication with the OSM API 0.6, i.e. uploading map data, notes and gpx tracks, downloading map data, notes, user data, etc.The dependency to
osmapi
must be replaced with an implementation based onideally the http client from Multiplatform HTTP Client (use Ktor Client) #5408 and
a multiplatform XML parser / writer, which is stable, well-tested and ideally (semi-)official / well-maintained and ideally but not necessarily compatible with
kotlinx-serialization
. This is also important for other XML parsing in the app, i.e. Add GPX import functionality #5369using
kotlinx-datetime
to parse timestamps (already a dependency)See interfaces
TracksApi
,MapDataApi
andNotesApi
XML Parser / Writer requirements
multiplatform support for at least Java/Android and iOS
stable, well-tested and ideally (semi-)official / well-maintained
xmlutil
There is currently one xml serializer compatible with kotlinx-serialization:
io.github.pdvrieze.xmlutil
. It is also mentioned in the Ktor docs, i.e. is the XML serializer/deserializer used in Ktor.I didn't find any other multiplatform XML parsers/writers.
The text was updated successfully, but these errors were encountered: