Skip to content

Commit dbcdefe

Browse files
committed
Revert "compatibility breaking change needed due to compile issues with kt-search"
This reverts commit b97ae58.
1 parent b97ae58 commit dbcdefe

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ class MyDsl : JsonDsl(
235235
) {
236236
// this will be snake cased
237237
var camelCase by property<Boolean>()
238-
var mySize by customProperty<Int>(
238+
var mySize by property<Int>(
239239
customPropertyName = "size"
240240
)
241-
var myVal by customProperty<String>(
241+
var myVal by property<String>(
242242
customPropertyName = "val"
243243
)
244244
// explicitly set name and provide a default
245-
var m by customProperty(
245+
var m by property(
246246
customPropertyName = "meaning_of_life",
247247
defaultValue = 42
248248
)

src/commonMain/kotlin/com/jillesvangurp/jsondsl/IJsonDsl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface IJsonDsl : MutableMap<String, Any?> {
3434
* with a kotlin keyword or super class property or method. For example, "size" is also a method on
3535
* MapBackedProperties and thus cannot be used as a kotlin property name in a Kotlin class implementing Map.
3636
*/
37-
fun <T : Any?> customProperty(customPropertyName: String, defaultValue: T?=null): ReadWriteProperty<Any, T>
37+
fun <T : Any?> property(customPropertyName: String, defaultValue: T?=null): ReadWriteProperty<Any, T>
3838

3939
/**
4040
* Helper to manipulate list value objects.

src/commonMain/kotlin/com/jillesvangurp/jsondsl/JsonDsl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ open class JsonDsl(
7272
*
7373
* If you specify a [defaultValue], it is added to the map.
7474
*/
75-
override fun <T : Any?> customProperty(customPropertyName: String, defaultValue: T?): ReadWriteProperty<Any, T> {
75+
override fun <T : Any?> property(customPropertyName: String, defaultValue: T?): ReadWriteProperty<Any, T> {
7676
if(defaultValue!= null) {
7777
_properties[customPropertyName] = defaultValue
7878
}

src/commonTest/kotlin/com/jillesvangurp/jsondsl/JsonDslTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MyDsl:JsonDsl() {
99
// will be snake_cased in the json
1010
var meaningOfLife by property<Int>()
1111
// we override the property name here
12-
var l by customProperty<List<Any>>("a_custom_list")
12+
var l by property<List<Any>>("a_custom_list")
1313
var m by property<Map<Any,Any>>()
1414
}
1515

src/jvmTest/kotlin/com/jillesvangurp/jsondsl/readme/ReadmeGenerationTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ val readmeMd = sourceGitRepository.md {
180180
) {
181181
// this will be snake cased
182182
var camelCase by property<Boolean>()
183-
var mySize by customProperty<Int>(
183+
var mySize by property<Int>(
184184
customPropertyName = "size"
185185
)
186-
var myVal by customProperty<String>(
186+
var myVal by property<String>(
187187
customPropertyName = "val"
188188
)
189189
// explicitly set name and provide a default
190-
var m by customProperty(
190+
var m by property(
191191
customPropertyName = "meaning_of_life",
192192
defaultValue = 42
193193
)

0 commit comments

Comments
 (0)