Deserializing maps with enum keys #2410
Replies: 2 comments
-
I believe that this is because the type |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer, I understand it much better now. Just to be a little more verbose... The problem lies in the fact that my The library indeed makes the difference based on The only way out of this would be to have an (implicit or explicit) conversion of |
Beta Was this translation helpful? Give feedback.
-
The library provides cool features to work with enums/enum classes. Lets have
Now I want to have a map whose keys are of the
enum class
type. I can do something like....However, if i try a easier way
...i get a strange error
[json.exception.type_error.302] type must be array, but is object
I have read through some issues, but mostly, they are concerned about serialization of such a map, not the opposite way.
Is this a desired behavior? Or is there some easier workaround I am missing?
Beta Was this translation helpful? Give feedback.
All reactions