-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use serialization-properties over AbstractDecoder. #403
Conversation
…s `ParametersDecoder` and `PlatformLinksHandler`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #403 +/- ##
=============================================
+ Coverage 80.59% 80.68% +0.08%
- Complexity 254 259 +5
=============================================
Files 674 673 -1
Lines 8868 8842 -26
Branches 746 743 -3
=============================================
- Hits 7147 7134 -13
+ Misses 1534 1523 -11
+ Partials 187 185 -2 ☔ View full report in Codecov by Sentry. |
links/src/commonTest/kotlin/com/splendo/kaluga/links/utils/LinksDecoderTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I would consider some improvements. in tests also would always recommend starting with the simplest test cases.
Check my comment (you can resolve it after reading)
FYI: #61 is resolved and has nothing to do with this PR ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I don't see anything wrong with the additions you made and the overall implementation of this feature.
In this sense, it can be merged after you make the Readme a bit more clear
But I keep thinking that there are too many limitations for a developer using this module, and in the sense we should consider a refactor.
Specifically, I think is better to avoid:
- forcing an order of params in the query
- passing nulls explicitely
- passing the size of a list
In the first 2 cases, consider using Serialization modules that do this for us automatically (even if we need to map the data un-efficiently at the beginning, queries are not so long): the good old kotlinx.serialization.json
or kotlinx.serialization.properties
The latter seems exactly what you need
links/src/commonMain/kotlin/com/splendo/kaluga/links/models/LinksHandler.kt
Outdated
Show resolved
Hide resolved
links/src/commonTest/kotlin/com/splendo/kaluga/links/manager/DefaultLinksManagerTest.kt
Outdated
Show resolved
Hide resolved
links/src/iosMain/kotlin/com/splendo/kaluga/links/manager/PlatformLinksHandler.kt
Outdated
Show resolved
Hide resolved
links/src/jsMain/kotlin/com/splendo/kaluga/links/manager/PlatformLinksHandler.kt
Outdated
Show resolved
Hide resolved
It would work only for white spaces before |
@corrado4eyes https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/trim-indent.html does exactly what @avdyushin says |
#412