Open omasseau opened 3 months ago
/cc @karesti (infinispan), @wburns (infinispan)
Note:
It seems boolean fields work only with records. I have no error when trying this :
@Proto
public record Person (String name, boolean isMarried) {
}
@ProtoSchema(includeClasses = { Person.class })
interface Schema extends GeneratedSchema {
}
Still this is not a solution for me as in my case I cannot use records.
@omasseau have you tried adding @ProtoField(defaultValue = "false")
over the field as a workaround?
In any case, this should work for records and classes. Opening an issue in Protostream @tristantarrant
@ProtoField(defaultValue = "false")
Hi @karesti
Yes it works, but only if I also explicitely define a number :
@ProtoField(defaultValue = "false", number = 2)
public boolean isMarried = false;
As you can guess, we don't really want to explicitely add this annotation on every boolean fields, as it somewhat defeats the expected benefits of having a protobuf schema being automatically generated for us :)
yes, I opened an issue @omasseau https://issues.redhat.com/browse/IPROTO-362 @fax4ever
Describe the bug
Using Infinispan extension, marshalling of POJOs with simple primitive boolean fields is not working and gives this error :
Yet the infinispan documentation says :
So I'm expecting the marshalling of boolean primitive type to work.
Here is the class :
Is this a quarkus limitation or the Infinispan documentation is wrong ? Having to change all my boolean fields to Boolean is not a solution. I'm expecting a framework/library to be able at least to marshall any primitive types out of the box ;)
Expected behavior
POJOs with boolean fields should be able to be marshalled out of the box
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
java 21.0.3
Quarkus version or git rev
3.12.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response