I am receiving a json object in which there is a property I don't know the name of at compile time.
The name of the property is stored in a variable.
Since the name of the property may vary the JSON is parsed as an Anonymous object.
Is it possible to read the value of the property using reflection using the name stored in the variable ?
I tried with code resembling this: jsonResponse::class.memberProperties.find { it.name == variableName }
with no success.
Aucun commentaire:
Enregistrer un commentaire