You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to generate ProtoBuf schema from a data class containing UInt field. The error is:
Exception in thread "main" java.lang.IllegalArgumentException: Invalid name of the field '[UNINITIALIZED]' in message 'UInt' for class with serial name 'kotlin.UInt'
at kotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator.checkIsValidIdentifier(ProtoBufSchemaGenerator.kt:538)
at kotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator.generateMessage(ProtoBufSchemaGenerator.kt:172)
at kotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator.generateProto2SchemaText(ProtoBufSchemaGenerator.kt:132)
at kotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator.generateSchemaText(ProtoBufSchemaGenerator.kt:84)
at kotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator.generateSchemaText$default(ProtoBufSchemaGenerator.kt:76)
at mypackage.ProtocolGeneratorKt.main(ProtocolGenerator.kt:14)
at mypackage.ProtocolGeneratorKt.main(ProtocolGenerator.kt)
To Reproduce
packagemypackageimportkotlinx.serialization.ExperimentalSerializationApiimportkotlinx.serialization.Serializableimportkotlinx.serialization.protobuf.schema.ProtoBufSchemaGenerator
@Serializable
data classWrapper(
valf:UInt,
)
@OptIn(ExperimentalSerializationApi::class)
funmain() {
val schemas =ProtoBufSchemaGenerator.generateSchemaText(listOf(Wrapper.serializer().descriptor))
println(schemas)
}
Expected behavior
Schema generated OK. Indeed this is the case after e.g. substitution of UInt with Long. Which is not desired.
Environment
Kotlin version: 1.7.10
Library version: 1.4.1
Kotlin platforms: JVM
The text was updated successfully, but these errors were encountered:
Unable to generate ProtoBuf schema from a data class containing UInt field. The error is:
To Reproduce
Expected behavior
Schema generated OK. Indeed this is the case after e.g. substitution of UInt with Long. Which is not desired.
Environment
The text was updated successfully, but these errors were encountered: