JSON Serialization Configuration
Flux.REST uses System.Text.Json to serialize request bodies and deserialize response bodies.
Each Flux Service registered with UsingRest has its own JsonSerializerOptions. Use ConfigureJsonSerializer to configure those options:
services.AddFlux(flux =>
{
flux.AddService("example-api")
.UsingRest("https://api.example.com")
.ConfigureJsonSerializer((JsonSerializerOptions options) =>
{
// Configure the JsonSerializerOptions here
});
});
The configuration applies to JSON request and response bodies for every Set belonging to the "example-api" Flux Service.
Tip
See the
JsonSerializerOptionsAPI reference for the available options.