Map complex object (dictionary) from appsettings.json to model
Hi,
i have a complex appsettings.json like this
How can I map this?
I have a class definition
and read the config like
When I check the
clientConfig
object, I see that the ProtectedResourceMap
has one entry: key="1" and value="user.read". How can I fix it so I have a list of dictionary entries?4 Replies
Well, it's not a dictionary in your JSON
So kinda hard to parse it into something it is not
is an array of arrays of strings-or-arrays
So
List<List<object>>
would be the closestOkay, got. That's way too complicated, I guess will leave Microsofts structure there 😄
Shouldn't this work?
The key is now "http" and value is empty
This should work, yeah
Not sure why it wouldn't
Couldnt get this to work. Changed it completely now 😄