4

我有proto 文件并使用ScalaPB生成了 Scala 类。输出如下所示:

@SerialVersionUID(0L)
final case class MetaData extends scalapb.GeneratedMessage {

    object HeightReferencePointEnum extends _root_.scalapb.GeneratedEnumCompanion[HeightReferencePointEnum] {
      implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[HeightReferencePointEnum] = this
        // generated code
     }
  }

由于这个 Scala 问题,我在上课时遇到getSimpleName了异常。HeightReferencePointEnum

有什么方法可以配置 ScalaPB 以避免内部类?

消息原型是:

message MetaData {
    message HeightDetail {
        optional HeightReferencePointEnum heightReferencePoint = 1;
        enum HeightReferencePointEnum {
            // enums
        }
        optional heightReferencePointEnum heightReferencePoint = 2;
    }
    repeated HeightDetail heightDetail = 1;
}
4

0 回答 0