Skip to main content
←API Reference ←NSDK ←Nsdk_Vps_Start

jsonString


Declaration​

func jsonString(options: JSONEncodingOptions = JSONEncodingOptions()) throws -> String

Summary​

Returns a string containing the JSON serialization of the message.
Unlike binary encoding, presence of required fields is not enforced when
serializing to JSON.

Returns​

A string containing the JSON serialization of the message.

Throws​

  • SwiftProtobufError or JSONEncodingError if encoding fails.

Parameters​

NameTypeSummary
optionsJSONEncodingOptions
The JSONEncodingOptions to use.

Overload​

static func jsonString<C>(from collection: C, options: JSONEncodingOptions = JSONEncodingOptions()) throws -> String where Self == C.Element, C : Collection

Summary​

Returns a string containing the JSON serialization of the messages.
Unlike binary encoding, presence of required fields is not enforced when
serializing to JSON.

Returns​

A string containing the JSON serialization of the messages.

Throws​

  • SwiftProtobufError or JSONEncodingError if encoding fails.

Parameters​

NameTypeSummary
optionsJSONEncodingOptions
The JSONEncodingOptions to use.