-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Disable property type cast to fix issue gh-291 #781
Disable property type cast to fix issue gh-291 #781
Conversation
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.
Good job, thanks for your contribution.
Just renamed it as KoinPropertyExt.kt
, can you test it?
Please also check conflicts |
@arnaudgiuliani Updated and tested. |
#795 should fix |
Ok, will check that asap 👍 |
just merged the PR |
can you double check @Swordsman-Inaction ? 🙏 |
@arnaudgiuliani Just merged |
Don't wanna be that guy - but yo - this really does not go into a bugfix release! this is a Major a release at best, Minor release at worst. If you are going to use semver at least respect it! |
I agree with @chrisjenx. This is a backward incompatible change. I'm stuck on 2.1.5 until I change how I pass config data around my app. FYI: I'm using Ktor which has a richer ApplicationConfig (it supports nesting and lists of values). Means I'll have to stop using properties and move it over to an injectable parameter. Would a patch that keeps the same external interface (getProperty, getIntProperty, getFloatProperty) be accepted? I'd add getAnyProperty or getTypedProperty and swap the map back to <string, any>. This way we can keep the string oriented interfaces for people who just want a flat PropertyList style but give others in my situation a good migration path. |
@@ -0,0 +1,63 @@ | |||
package org.koin.ext |
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.
This file isn't complete enough.
On the previous version getProperty
was accessible from Scope
as well.
For example:
single {
ConnectionPool (
maxConnections = getIntProperty("CONNECTION_POOL__MAX_CONNECTIONS")
)
}
is not going to work, but should IMHO.
Fixes #291
Two changes(Breaking changes):
String
int
andfloat
properties.Before:
getKoin().getProperty<Int>("int.value")
getKoin().getProperty<Float>("float.value")
Now:
getKoin().getIntProperty("int.value")
getKoin().getFloatProperty("float.value")