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 casing is camel case. It’s possible to configure a different default response serialization casing when configuring ServiceComposer:

builder.Services.AddRouting();
builder.Services.AddViewModelComposition(options =>
{
    options.ResponseSerialization.DefaultResponseCasing = ResponseCasing.PascalCase;
});

snippet source | anchor

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