Google.Protobuf.JsonFormatter.Settings

Settings controlling JSON formatting.

Summary

Constructors and Destructors

Settings(bool formatDefaultValues)
Creates a new Settings object with the specified formatting of default values and an empty type registry.
Settings(bool formatDefaultValues, TypeRegistry typeRegistry)
Creates a new Settings object with the specified formatting of default values and type registry.

Properties

Default
Default settings, as used by JsonFormatter.Default
FormatDefaultValues
bool
Whether fields whose values are the default for the field type (e.g.
TypeRegistry
The type registry used to format Any messages.

Properties

Default

Settings Default

Default settings, as used by JsonFormatter.Default

FormatDefaultValues

bool FormatDefaultValues

Whether fields whose values are the default for the field type (e.g.

0 for integers) should be formatted (true) or omitted (false).

TypeRegistry

TypeRegistry TypeRegistry

The type registry used to format Any messages.

Public functions

Settings

 Settings(
  bool formatDefaultValues
)

Creates a new Settings object with the specified formatting of default values and an empty type registry.

Details
Parameters
formatDefaultValues
true if default values (0, empty strings etc) should be formatted; false otherwise.

Settings

 Settings(
  bool formatDefaultValues,
  TypeRegistry typeRegistry
)

Creates a new Settings object with the specified formatting of default values and type registry.

Details
Parameters
formatDefaultValues
true if default values (0, empty strings etc) should be formatted; false otherwise.
typeRegistry
The TypeRegistry to use when formatting Any messages.