Another kinda related question. Is there a way to get the name of the current element from the KInput? I guess this may only apply to JSON though.
s
sandwwraith
10/22/2018, 12:18 PM
you can get current index, and then map it using method of
KSerialClassDesc
. It is equal to property name by default.
p
pablisco
10/22/2018, 12:36 PM
But that's order dependent right?
s
sandwwraith
10/22/2018, 2:07 PM
Dependent on order inside class declaration in source file. JSON parser will determine current element even if they’re out-of-order in JSON and return correct index.
p
pablisco
10/22/2018, 3:58 PM
Since I've got you here 🙂 what's the best way to parse a field that depends on information from another?