public class ValidatePhoneNumberReceived{ public bool Success { get; set; } public ValidatePhoneNumberData Data { get; set; } public class ValidatePhoneNumberData { public string Number { get; set; } public Dictionary<string, object> AccountDetails { get; set; } }}
public class ValidatePhoneNumberReceived{ public bool Success { get; set; } public ValidatePhoneNumberData Data { get; set; } public class ValidatePhoneNumberData { public string Number { get; set; } public Dictionary<string, object> AccountDetails { get; set; } }}
Then I do some stuff, and return the same model from my own API.
AccountDetails
AccountDetails
contains
object
object
, because for each key, the external API returns a different set of properties, as we see in the json
account_details.google
account_details.google
, and
account_details.whatsapp
account_details.whatsapp
etc.
They appear in my response with the same snake case I received them with. I have even tried adding an action filter to add a
NewtonsoftJsonOutputFormatter
NewtonsoftJsonOutputFormatter
set to camel case.
How can I force the dynamic properties to be camel case?