jsonUTF8Bytes(options:)

Returns a SwiftProtobufContiguousBytes containing the UTF-8 JSON serialization of the message.

Message+JSONAdditions.swift:47
func jsonUTF8Bytes<Bytes>(options: JSONEncodingOptions = JSONEncodingOptions()) throws -> Bytes where Bytes : SwiftProtobufContiguousBytes

Parameters

options

The JSONEncodingOptions to use.

Returns

A SwiftProtobufContiguousBytes 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.