Skip to content
Discussion options

You must be logged in to vote

I spent a bit of time with this today.

Root Cause Analysis

The Problem

In ProtobufSerializer.java, the validation compares two ProtobufFile objects:

  1. fileBefore: Schema from the registry (the .proto text file that was registered)
  2. fileAfter: Schema extracted from the Java class's FileDescriptor using toProtoFileElement()

The issue is in FileDescriptorUtils.fileDescriptorToProtoFile(). When converting a
FileDescriptor (from compiled Java classes) back to a ProtoFileElement, it processes reserved fields:

for (String reservedName : descriptor.getReservedNameList()) {
  ReservedElement reservedElem = new ReservedElement(DEFAULT_LOCATION, "",
          Collections.singletonList(reservedName));
  

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
3 replies
@Rahul-20
Comment options

@EricWittmann
Comment options

@Rahul-20
Comment options

Comment options

You must be logged in to vote
1 reply
@EricWittmann
Comment options

Answer selected by EricWittmann
Comment options

You must be logged in to vote
5 replies
@EricWittmann
Comment options

@EricWittmann
Comment options

@Clark1992
Comment options

@EricWittmann
Comment options

@EricWittmann
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants