You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.
Version
4.5.9
Context
I have been trying to use service proxies and DataObjects but I have found it difficult to implement the json deserializer as a constructor. I am using lombok @Value which dont seem to be compatible with @JsonGen and I would like to use something more flexible than writing all the serializers myself.
I noticed in the @DataObject annotated types section it mentions there is a static factory method fromJson(JsonObject json) which can be used. When I tried to implement this the code generation didnt pick this up as a deserializer. I looked into the code and found many places where the JsonObject constructor is assumed instead of checking for the static factory.
It looks like the TypeMirrorFactory.java around line 159 seems to be the source of the issue however there are many other places this constructor is assumed.
Do you have a reproducer?
It can be reproduced by creating a DataObject as follows:
@DataObject
public MyDataObject {
String name;
public static MyDataObject fromJson(JsonObject json) {
return json.mapTo(MyDataObject.class);
}
public JsonObject toJson() {
new JsonObject("name", this.name);
}
}
Steps to reproduce
Run vertx-codegen annotation processor
The text was updated successfully, but these errors were encountered:
Questions
Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.
Version
4.5.9
Context
I have been trying to use service proxies and DataObjects but I have found it difficult to implement the json deserializer as a constructor. I am using lombok
@Value
which dont seem to be compatible with@JsonGen
and I would like to use something more flexible than writing all the serializers myself.I noticed in the @DataObject annotated types section it mentions there is a static factory method
fromJson(JsonObject json)
which can be used. When I tried to implement this the code generation didnt pick this up as a deserializer. I looked into the code and found many places where the JsonObject constructor is assumed instead of checking for the static factory.It looks like the TypeMirrorFactory.java around line 159 seems to be the source of the issue however there are many other places this constructor is assumed.
Do you have a reproducer?
It can be reproduced by creating a DataObject as follows:
Steps to reproduce
The text was updated successfully, but these errors were encountered: