0

I need to connect to a JSON interface for which I have a XSD specification of its objects.

I can generate the POCO's from the XSD using xsd.exe, but these POCOS have UpperCamelCase properties. If I serialize them to JSON I get UpperCamelCase properties instead of the desired lowerCamelCase.

My workaround was to manually annotate the POCO's with JsonProperty attributes, but that means that if I need to regenerate the objects due to some change in the XSD I will lose my annotations.

Is there some way to automate this?

lpacheco
  • 976
  • 1
  • 14
  • 27
  • 1
    You might find [this answer](https://stackoverflow.com/a/22483122/967736) useful. – IPValverde Feb 27 '18 at 19:47
  • 1
    Or, if you don't have access to your serializer settings so can't use `CamelCasePropertyNamesContractResolver` as suggested by @IPValverde, you can apply `[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]` to your partial types as shown [here](https://stackoverflow.com/a/44805815/3744182). – dbc Feb 27 '18 at 21:28

0 Answers0