SharpYaml icon indicating copy to clipboard operation
SharpYaml copied to clipboard

Convert the properties names from snake_case to PascalCase

Open mdmoura opened this issue 7 years ago • 0 comments
trafficstars

I am using snake_case on an YAML file and deserializing it as follows:

  serializer = new Serializer(new SerializerSettings {
     DefaultStyle = YamlStyle.Block,              
     EmitAlias = false,
     IndentLess = true,
     NamingConvention = new DefaultNamingConvention(),
     PreferredIndent = 2,
     SortKeyForMapping = false            
  });

  var result = serializer.Deserialize(yaml);

I get an object where the properties names are still in snake_case like 'is_active', etc.

I need to convert the properties names from snake_case in the YAML to PascelCase in the deserialized object.

How can I do this?

mdmoura avatar Oct 04 '18 18:10 mdmoura