codegen/src/main/kotlin/org/web3j/openapi/codegen/utils/KPoetUtils.kt Original file line numberDiff line numberDiff line change @@ -42,8 +42,8 @@ internal fun List<NamedType>.toDataClass( forEachIndexed { index, input -> val inputName = GeneratorUtils.argumentName(input.name, index) ...
[Kotlin]PrimitiveTypesand String fun main() { val a = 4 val b: Byte = 127 val c: Short = 123 val d: Int = 7 val e: Long = 123456789 val f: Float = 3.73f val g: Double = 3.73 val h: Ch Kotlin 转载 mb5ff5933087b38 ...
which is more sensible. Things just get tricky with respect to division of responsibilities; if there is a way for deserializer to provide something to indicate runtime to populate values maybe that could work. I don't know Kotlin run
@@ -134,15 +141,59 @@ class KotlinSerializerCodecTest { private val allBsonTypesDocument = BsonDocument.parse(allBsonTypesJson) @Test fun testDataClassWithSimpleValues() { val expected = """{"char": "c", "byte": 0, "short": 1, "int": 22, "long": {"$numberLong": "42"}, ...