ServiceComposer.AspNetCore

Response serialization casing

ServiceComposer serializes responses using a JSON serializer. By default responses are serialized using camel casing, a C# SampleProperty property is serialized as sampleProperty. Consumers can influence the response casing of a specific request by adding to the request an Accept-Casing custom HTTP header. Accepted values are casing/camel (default) and casing/pascal.

Default response serialization casing

Available starting with v1.8.0

Default response serialization is camel casing. It’s possible to configure a different default response serialization casing when configuring ServiceComposer:

public void ConfigureServices(IServiceCollection services)
{
    services.AddRouting();
    services.AddViewModelComposition(options =>
    {
        options.ResponseSerialization.DefaultResponseCasing = ResponseCasing.PascalCase;
    });
}

snippet source | anchor

Requests containing the Accept-Casing custom HTTP header will still be honored.