Comments (7)
@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.
from jackson-dataformats-binary.
Unfortunately I can not reproduce this: if I load schema you specify, there is no error.
This could either be due to version you are using (if it's old, could be fixed), or your code does something different that what I have. My test has:
ProtobufSchema schema = MAPPER.schemaLoader()
.load(new StringReader(SCHEMA_STR));
with schema s above.
from jackson-dataformats-binary.
Thanks for the quick response. I simplified my test code. The only difference is that I specified the rootTypeName
"t2". I'm using the HEAD of the 2.8 branch pulled today.
ProtobufSchema schema = MAPPER.schemaLoader()
.load(new StringReader(SCHEMA_STR), "t2");
And then the stacktrace
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:94)
at com.fasterxml.jackson.dataformat.protobuf.schema.NativeProtobufSchema.forType(NativeProtobufSchema.java:67)
at com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufSchemaLoader.load(ProtobufSchemaLoader.java:97)
from jackson-dataformats-binary.
Thanks! Yes, that does trigger the issue for me too, for 2.8 branch and probably master
too.
from jackson-dataformats-binary.
(accidental fix by github, due to comment)
from jackson-dataformats-binary.
I am trying to understand the code base, and I saw the type resolver tries to find the name recursively but it's a little hard for me to fix. I wonder if it's easy for you to fix.
My idea is to calculate fully qualified name beginning with the package name at the time of parsing so that the type resolver does not have to traverse the type tree. Do you think it's a sane approach?
from jackson-dataformats-binary.
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.
from jackson-dataformats-binary.
Related Issues (20)
- Cannot deserialize byte[] from avro schema HOT 4
- CBOR - Default generator generates object with map(*) instead of map(2) HOT 1
- `logback-test.xml` in the Main Avro resources folder can cause runtime issues for applications HOT 11
- `Smile` decoding issue with `NonBlockingByteArrayParser`, concurrency HOT 4
- Avro generator does not enforce `StreamWriteConstraints` (2.16 / 3.0.0-SNAPSHOT)
- JsonEnumDefaultValue not supported when using AvroMapper to generate schema from JAVA class HOT 3
- Support for StreamReadConstraints for CBOR, Smile backends HOT 1
- Refactor Smile format module use of `ThreadLocal` to be bound to `SmileFactory` HOT 1
- Honor READ_ENUMS_USING_TO_STRING feature when deserializing HOT 3
- Honor `READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE` feature with Protobuf HOT 5
- Rewrite Smile buffer recycling (`SmileBufferRecycler`) to use new (2.16) `RecyclerPool`, allow configuring use of non-ThreadLocal based pools HOT 2
- Rewrite Avro buffer recycling (`ApacheCodecRecycler.java`) to use new (2.16) `RecyclerPool`, allow configuring use of non-ThreadLocal based pools
- CVE in avro prior to v1.11.3 HOT 2
- Remove Smile-specific buffer-recycling
- Update `com.amazon.ion:ion-java` to 1.10.5 (from 1.9.5)
- (avro) Snyk Reports a Critical Vulnerability (org.codehaus.jackson:jackson-mapper-asl Improper Input Validation) -- NOT APPLICABLE (polymorphic deserialization) HOT 3
- Avro does not respect default values defined in schema HOT 8
- `IonReader` classes contain assert statement which could throw unexpected `AssertionError` HOT 1
- `IndexOutOfBoundsException` thrown by `IonReader` implementations are not handled HOT 1
- Avro generation failed with enums containing values with special characters HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-dataformats-binary.