Convert Enum to string in OC and YesSql #13154
Replies: 2 comments 1 reply
-
Other option, always set associated values to enums. And don't change them or reuse them. Because otherwise you have the other issue that you'd want to rename it and would break the data. |
Beta Was this translation helpful? Give feedback.
-
Explicitly specify values of enumeration types before using custom serialization properties Read=1,
Write=2,
ReadAndWrite=3 To serialize a particular property into an object, for example: { FilePermission: {"1":"Read"} } When deserializing, only the Key value is taken For compatibility with older versions, we can also handle compatibility in a custom serialization feature |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Currently, we store the enum as in. Problem with this approach if someone change the enum order or adds a new value in a place other than the default, it'll cause problem. Also, if someone is looking at the raw json file like in the workflow for example, it's hard to understand that the int value means.
Describe the solution you'd like
Convert Enum to string in OC and YesSql
Beta Was this translation helpful? Give feedback.
All reactions