Utf8Json Serializer

Project Hosting
NuGet Package NServiceBus.Utf8Json (1.x) | License
This is a community run project. License and support are independent of Particular Software.
Target NServiceBus Version: 6.x

Using JSON via a NuGet dependency on Utf8Json.

Usage

endpointConfiguration.UseSerialization<Utf8JsonSerializer>();

Resolver

Customizes the instance of IJsonFormatterResolver used for serialization.

var serialization = endpointConfiguration.UseSerialization<Utf8JsonSerializer>();
serialization.Resolver(StandardResolver.SnakeCase);

Custom Content Key

When using additional deserializers or transitioning between different versions of the same serializer it can be helpful to take explicit control over the content type a serializer passes to NServiceBus (to be used for the ContentType header).

var serialization = endpointConfiguration.UseSerialization<Utf8JsonSerializer>();
serialization.ContentTypeKey("custom-key");

Currently not supported

Usages of DataBusProperty<T> since it doesn't have a default constructor. However usage of the databus convention is supported.

Samples


Last modified