I have a JSON object and one property of this JSON is a dictionary that can receive a string value or an array of string values.
My question is: is it possible to deal with this case using a dictionary with a conditional generic parameter, example: Dictionary<string, string || string[]>
?
Because i need to deserialize the values in one dictionary.
Following bellow a example of JSON object, where clientContent
needs to map to such a dictionary:
"clientConfDesc": {
"clientContent": {
"app.log.mail.port": "",
"app.log.mail.protocol": "",
"app.log.mail.receiver": "",
"app.log.mail.server": "",
"app.lookupDaemon.interval": "",
"app.lookupDaemon.use": "yes",
"app.remoteCall.ttl": "",
"app.typeDef": ["5, , PD, PEDIDO"]
}
}
Note: I know that the object of this example JSON is a class, but the properties of this class are variable, that is, I cannot map them because a property may cease to exist or new properties may be added, this is why I treat it this case as a dictionary because I want to delete or add parameters later in this class.