-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@DataObject does not handle json in String format when generating Converters #312
Comments
this is the expected behavior. |
This looks like the place where the fix should be applied. https://github.com/vert-x3/vertx-codegen/blob/ca12c22dc7ae8ef1017a24d9fde06be0447801e0/src/main/java/io/vertx/codegen/generators/dataobjecthelper/DataObjectHelperGen.java#L300 |
we are not looking to change this behavior @pendula95 as this is the expected one |
Than I would change this from bug to enhancement as I see a need for this. |
Consider the case where somebody does not want this behavior: e.g the application does not want to parse a string containing when it receives invalid JSON |
Version
3.9.2
Context
When @'DataObject' is generated with its fromJson method objects that are import io.vertx.core.json.JsonObject only accept JsonObject as valid option for mapping. Example generated constructor:
private JsonObject attributes;
For this property following code is generated:
Generated code should be like:
If for example from DB I get a String field that has JSON formating this property will never get mapped. On the other hand if this POJO is generated by Jackson function this field with get mapped.
SomeDTO someDTO = json.mapTo(SomeDTO.class);
Extra
Is this something that was intended or just wasn't considered. In my eyes this is a standard approach as vertx json wrapper accepts String as valid for when generating Json objects. I can submit a PR if we agree to go with this.
The text was updated successfully, but these errors were encountered: