robfletcher
02/26/2018, 5:29 PMkrotki
02/26/2018, 5:32 PMrrader
05/14/2018, 11:33 AMclass User(val name: String, val isAdmin: Boolean)
it is serialialized in object with "admin" property, but not "is_admin", is this a bug?mp
05/20/2018, 2:07 PMbrandon
06/12/2018, 8:01 PMLint Failure
../../../core: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
KotlinReflectionInternalError:KClassImpl.reportUnresolvedClass(KClassImpl.kt:301)
←KClassImpl.access$reportUnresolvedClass(KClassImpl.kt:42)
←KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:52)
←KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:43)
←ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:93)
←ReflectProperties$Val.getValue(ReflectProperties.java:32)
←KClassImpl$Data.getDescriptor(KClassImpl.kt:-1)
←KClassImpl.getDescriptor(KClassImpl.kt:172)
You can set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout.
sdeleuze
06/21/2018, 2:03 PMsdeleuze
06/28/2018, 9:43 AMwakingrufus
09/17/2018, 8:41 PM@JsonCreator
in kotlin? I tried it as an extension function, an jackson doesn't see it. This is the delegate/Map variant of a JsonCreatormp
09/19/2018, 4:32 PMkds
09/25/2018, 6:04 PMdata class SID(
@Pattern(regexp="[0-9a-zA-Z]{1,50}", message = "Недопустимые символы в SID")
val sid: String
) {
override fun toString(): String {
return sid
}
}
The jackson v. 2.9.7 shows me an error when I try to deserialize SID from string in message
{
"sid": "qweasdzxc",
"date": 1537893098
}
Error:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `SID` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('qweasdzxc')
at [Source: (String)"{
"sid":"qweasdzxc",
"date":1537893098,
...
napperley
10/22/2018, 12:28 AMrobfletcher
11/02/2018, 8:50 PMrrader
11/22/2018, 11:06 AMSteven McLaughlin
12/13/2018, 3:27 PMmorbidmerve
03/12/2019, 1:25 PM.
in the decimal string. error message: was expecting comma to separate Array entries
. As far as i can tell jackson is supposed to parse this type just fine as long as the decimal value is encapsulated in "
. Has anyone maybe had a similar issue with this?
Slack ConversationHorv
03/14/2019, 4:25 PMreik.schatz
03/28/2019, 11:41 AMimport com.fasterxml.jackson.annotation.JsonUnwrapped
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
data class Container(@JsonUnwrapped val row: Map<String, Any?>)
class JsonUnwrappedTest {
@Test
fun `should unwrap`() {
val row = Container(row = mapOf("foo" to "bar"))
val objectMapper = ObjectMapper()
objectMapper.registerModule(KotlinModule())
val json = objectMapper.writeValueAsString(row)
assertThat(json).isEqualTo("""{"foo": "bar"}""") // fails
}
}
hho
04/01/2019, 11:13 AMobject
, i.e. returning always the same instance for a certain JsonSubTypes.Type
?mp
04/17/2019, 3:42 PMnapperley
04/29/2019, 10:31 PMcom.fasterxml.jackson.databind.exc.MismatchedInputException: Expected array or string.
at [Source: (StringReader); line: 5, column: 19] (through reference chain: org.example.battery_info.cli_client.BatteryInfoResult["batteryInfoList"]->java.lang.Object[][0]->org.example.battery_info.cli_client.model.http.BatteryInfo["timestamp"])
What does this error mean?napperley
05/02/2019, 6:53 AMorg.example.battery_info.model.http.SensorDataTimestampRangeBody
(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('{"owner":"Joe Bloggs","site":"House","timestampRange":{"endDay":3,"endHour":12,"endMinute":0,"endMonth":5,"endYear":2019,"startDay":2,"startHour":12,"startMinute":0,"startMonth":5,"startYear":2019}}'
Upon inspection the JSON structure matches correctly to the data classes yet deserialization fails when the Android client makes a HTTP request. The CLI client works fine without any issues. Is there a way to fix the JSON deserialization issue? Is the issue related to this GitHub issue ( https://github.com/FasterXML/jackson-module-kotlin/issues/91 )?Maksim Vlasov
06/04/2019, 10:28 AMJukka Siivonen
06/24/2019, 11:05 AMEsau Betancourt
07/26/2019, 4:10 PMopen class Animal(@JsonProperty("id") val id: Long,
@JsonProperty("name")val name: String)
class Dog (id: Long,
name: String,
@JsonProperty("favorite_toy")val favoriteToy: String) : Animal(id, name)
fun main () {
val json = configuredObjectMapper()
.writeValueAsString(Dog(1, "FIDO", "something"))
println(json)
val a =
configuredObjectMapper().readValue(json, Dog::class.java)
println("${a.id} ${a.name} ${a.favoriteToy}")
}
Bernhard
09/26/2019, 3:36 PMthana
10/18/2019, 5:16 PMinternal
property will rendered in json like propertyname$modulename
AND @JsonIgnore
will have no effect?Dariusz Kuc
03/17/2020, 3:50 PM@JsonValue
for deserialization - e.g. I need to create wrapper around String
value
data class Example(@JsonValue val value: String)
above gets correctly serialized to just that actual value
. Wondering if there is some handy annotation to deserialize it back without writing custom deserializer - or custom deserializer is the only way?Dariusz Kuc
04/24/2020, 3:03 PMException in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.Foo (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.Foo is in unnamed module of loader 'app')
tim
05/15/2020, 12:39 PM@JsonDeserialize(using = FirestoreTimestampDeserializer::class)
if possible?kds
06/15/2020, 4:56 PMdata class AAA(val list: List[String])
. How is to enable list deserialization as empty list instead of null?