Include NULL Values in JSON on a specific request

So found this…
If this is how to do it… I don’t like how it would be hidden in AppHost. It’s not as clear/explicit as an attribute would be that a request would include NULLs.

But if that is the only way then that is how it shall be.

JsConfig<Dto>.RawSerializeFn = (obj) =>
{
    using (JsConfig.With(includeNullValues: true))
    {
        return obj.ToJson();
    }
};

JsConfig<Dto>.RawDeserializeFn = (json) =>
{
    using (JsConfig.With(includeNullValues: true))
    {
        return JsonSerializer.DeserializeFromString<Dto>(json);
    }
};

Source: Response DTOS doesnt show properties with null value