jsonString(options:)

Returns a string containing the JSON serialization of the message.

Message+JSONAdditions.swift:28
func jsonString(options: JSONEncodingOptions = JSONEncodingOptions()) throws -> String

Parameters

options

The JSONEncodingOptions to use.

Returns

A string containing the JSON serialization of the message.

Throws

SwiftProtobufError or JSONEncodingError if encoding fails.

Unlike binary encoding, presence of required fields is not enforced when serializing to JSON.