I hope this hasn’t been asked before; I’ve searche...
# klaxon
c
I hope this hasn’t been asked before; I’ve searched the message archive for this channel for the last few weeks. The Klaxon README says you can do this:
Copy code
val result = Klaxon()
    .parse<Person>("""
    {
      "name": "John Smith",
    }
    """)

assert(result.name == "John Smith")
assert(result.age == 23)
That implies that
Klaxon().parse<Person>()
returns a
Person
. However, it seems like that method actually returns a
Person?
. So which is the correct behaviour? Currently I work around the difference by using
!!
but I’d love to avoid using that if possible.