jsonString
Declaration
func jsonString(options: JSONEncodingOptions = JSONEncodingOptions()) throws -> String
Summary
Returns
A string containing the JSON serialization of the message.
Throws
SwiftProtobufErrororJSONEncodingErrorif encoding fails.
Parameters
| Name | Type | Summary |
|---|---|---|
| options | JSONEncodingOptions | 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
SwiftProtobufErrororJSONEncodingErrorif encoding fails.
Parameters
| Name | Type | Summary |
|---|---|---|
| options | JSONEncodingOptions | The JSONEncodingOptions to use. |
Returns a string containing the JSON serialization of the message.
Unlike binary encoding, presence of required fields is not enforced when
serializing to JSON.