You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the online C# classes generator from JSON example(s) I'd often prefer if the generator did not attempt to guess that some properties are enumerations and left them all as strings. Preferably with the list of options found in the example JSONs in a comment next to the property.
[JsonProperty("volumeLabelKey")] public VolumeLabelKeys VolumeLabelKey { get; set; } ... public enum VolumeLabelKeys { Kg, Ks, Lt, Ls } // and a convertor down below
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When using the online C# classes generator from JSON example(s) I'd often prefer if the generator did not attempt to guess that some properties are enumerations and left them all as strings. Preferably with the list of options found in the example JSONs in a comment next to the property.
/// <summary>kg, ks, lt, st</summary> [JsonProperty("volumeLabelKey")] public string VolumeLabelKey { get; set; }
in place of
[JsonProperty("volumeLabelKey")] public VolumeLabelKeys VolumeLabelKey { get; set; } ... public enum VolumeLabelKeys { Kg, Ks, Lt, Ls } // and a convertor down below
Beta Was this translation helpful? Give feedback.
All reactions