Table of Contents

Class JsonFormatterAttribute

Namespace
ToSic.Sxc.WebApi
Assembly
ToSic.Sxc.WebApi.dll

Mark a WebApi to use the modern Json Formatter based on System.Text.Json. Without this, older WebApi Controllers use the Newtonsoft JSON Formatter. Also provides additional configuration to make certain work easier.

[PublicApi]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method)]
public class JsonFormatterAttribute : Attribute, _Attribute
Inheritance
JsonFormatterAttribute
Implements

Remarks

  • new in v15.08

Properties

Casing

Specify how resulting objects should be cased. Default is Camel. Will affect both normal object properties as well as Dictionary keys.

public Casing Casing { get; set; }

Property Value

Casing

EntityFormat

Specify how IEntity objects in the result should be formatted. Default is Light.

public EntityFormat EntityFormat { get; set; }

Property Value

EntityFormat