scalapb / ScalaPB

Protocol buffer compiler for Scala.
https://scalapb.github.io/
Apache License 2.0
1.3k stars 281 forks source link

toJavaProto/fromJavaProto is incomplete for FieldOptions on UnknownFieldSet #934

Open mantasindrasius opened 4 years ago

mantasindrasius commented 4 years ago

Conversions from java protobuf library to scala and back are missing the

Misses UnknownFieldSet in one of the fields:

FileDescriptorProto.fromJavaProto(javaFileDescriptorProto)

This works:

FileDescriptorProto.parseFrom(javaFileDescriptorProto.toByteArray)

The methods seems lacking the UnknownFieldSet setters: https://github.com/scalapb/ScalaPB/blob/master/scalapb-runtime/src/main/scalajvm/com/google/protobuf/descriptor/FieldOptions.scala#L211

thesamet commented 4 years ago

@mantasindrasius , thanks for reporting! I confirm that unknown fields are not converted to/from java for any ScalaPB message. Will you be able to work on a PR for this?

mantasindrasius commented 4 years ago

Not sure at the moment, but I'll notify in case I'll be able to.

thesamet commented 4 years ago

@mantasindrasius That's ok. For context, does this issue has practical implications on your project or is it just a gap that you've identified?