[protobuf] . can't resolve inner types
See original GitHub issueWhen messages are defined as below, the parser failed to resolve t1.i1 type.
package mypackage;
message t1 {
message i1 {
optional uint32 x = 1;
optional uint32 y = 2;
}
}
message t2 {
optional t1.i1 z = 1;
}
Error
Exception in thread "main" java.lang.IllegalArgumentException: Unknown protobuf field type 't1.i1' for field 'z' of MessageType 't2' (known enum types: ; known message types: t1, t2)
at com.fasterxml.jackson.dataformat.protobuf.schema.TypeResolver._resolve(TypeResolver.java:141)
at com.fasterxml.jackson.dataformat.protobuf.schema.TypeResolver.resolve(TypeResolver.java:93)
at com.fasterxml.jackson.dataformat.protobuf.schema.NativeProtobufSchema.forType(NativeProtobufSchema.java:67)
at com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufSchemaLoader.load(ProtobufSchemaLoader.java:51)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Language Guide (proto3) | Protocol Buffers - Google Developers
Defining A Message Type; Scalar Value Types; Default Values; Enumerations; Using Other Message Types; Nested Types; Updating A Message Type; Unknown Fields ...
Read more >Protobuf message in inner package cannot be imported
I'm trying to generate Java code for a proto message that has a reference to another message in a deeper package. When generating...
Read more >Null nested messages · Issue #35 · protobuf-net ... - GitHub
This makes ProtoStuff look into the Schema and find that field 11 is of type Location and it starts handling the nested message....
Read more >protobufjs - npm
protobuf.js is a pure JavaScript implementation with TypeScript support for node.js and the browser. It's easy to use, blazingly fast and works ...
Read more >Package com.google.protobuf | Java client library
Protobuf library provides support to pack/unpack Any values in the form of utility ... Extended type Inner type Extension Use registry.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@knoguchi I was hoping to fix this along with #140, as I now understand the issue finally (it has been a while but I got back to here). Scoped resolution works with latest fixes but only in certain orders of traversal; I’ll have to rewrite code a bit. Should get done for 2.10.0 however, need to get 2.9.8 out first.
I just noticed FieldElement or DataType.NamedType class does not have methods that returns qualified name or type unlike TypeElement class that has
.qualifiedName()
. So we still need type resolution for the fields.Looks like the Wire, the successor of the ProtoParser, was created for the very reason.
I hope someday ProtoParser will be replaced for Wire in this project. For now, I decided to use other solutions. Thanks.