MV-GH / LemmyBackwardsCompatibleAPI

Kotlin multiplatform Backward compatible Lemmy API
GNU Affero General Public License v3.0
4 stars 1 forks source link

Structural changes #40

Closed MV-GH closed 3 months ago

MV-GH commented 5 months ago

Originally I had planned to do only concrete implementations of the API every minor version, and update the existing implementation with every patch. But with release of Lemmy 0.19.4 I realize this approach is no longer feasible. Too easy to make non backwards compatible changes, DTOs are mess no longer easily visible which fields exists in which minor patch.

So instead every patch will needs it own implementation that will be an exact match for that version. Meaning it will no longer hold properties that don't exist in the current patch but in previous patch that must still be kept for compatibility.

Each patch will need its own mapper to the "universal" types. Each patch will only have the endpoints that it supports. So each patch will need to implement a wrapper for its universal endpoint.

The only drawback is that this will be significantly more work. Especially since I haven't made the universal types / API yet.

Newer versions should still fallback to an older implementation if a implementation for that version doesn't exist yet.