Is it possible to format a dictionary? #324
Unanswered
iliashkolyar
asked this question in
Q&A
Replies: 1 comment 4 replies
-
The placeholder should be |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using an old version (2.5.3) in which I am overriding the default braces -
Smart.Default.Parser.UseAlternativeBraces('±', '§');
I'm using it to create dynamic JSON payloads constructed by received parameters, for example:
Now this works great with nested
values
dictionary and even works properly for lists (with some workaround that I had to do because #321 didn't work in this version).Question is, is it possible to inject a
Dictionary<string, object>
similarly to the way we add a list?Something like this:
Currently, it just calls the
ToString
of theDictionary<string, object>
and I receive:Is there some way of making the Dictionary actually format its keys and values according to their
ToString
instead of performing theToString
on the dictionary itself?In the above example, I would like to receive:
Hope I made myself clear,
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions