generateSchemaText

fun generateSchemaText(    rootDescriptor: SerialDescriptor,     packageName: String? = null,     options: Map<String, String> = emptyMap()): String

Generate text of protocol buffers schema version 2 for the given rootDescriptor. The resulting schema will contain all types referred by rootDescriptor.

packageName define common protobuf package for all messages and enum in the schema, it may contain 'a'..'z' letters in upper and lower case, decimal digits, '.' or '_' chars, but must be started only by a letter and not finished by a dot.

options define values for protobuf options. Option value (map value) is an any string, option name (map key) should be the same format as packageName.

The method throws IllegalArgumentException if any of the restrictions imposed by ProtoBufSchemaGenerator is violated.


fun generateSchemaText(    descriptors: List<SerialDescriptor>,     packageName: String? = null,     options: Map<String, String> = emptyMap()): String

Generate text of protocol buffers schema version 2 for the given serializable descriptors. packageName define common protobuf package for all messages and enum in the schema, it may contain 'a'..'z' letters in upper and lower case, decimal digits, '.' or '_' chars, but started only from a letter and not finished by dot.

options define values for protobuf options. Option value (map value) is an any string, option name (map key) should be the same format as packageName.

The method throws IllegalArgumentException if any of the restrictions imposed by ProtoBufSchemaGenerator is violated.