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
Thanks for the great work! I really liked this library and planning to use in our project. One question I had was, how to correctly write the following with RandomizerArgument annotation:
// GenericStringRandomizer takes a String [] as argument...@Randomizer(value = GenericStringRandomizer.class, args = {
@RandomizerArgument(value = "Jhon, Doe", type = String[].class) // this is surely not the correct way
})
StringfirstName;
This does not work ofcourse and says Caused by:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String[] out of VALUE_STRING token .
I was wondering how to pass a textual representation of String array... any clue?
The text was updated successfully, but these errors were encountered:
Jackson is able to convert an array of String values to an
array of other Java types. However, it does not parse a raw
String and split it if it is intended to be mapped to an array.
This commit prepares the data for Jackson by splitting the
value of `RandomizerArgument` when its type is an array.
NB: The goal is to cover simple use cases of comma separated
values like reported in #299. There is no plan to make this
feature support custom separator, date format, number format, etc.
Thank you for reporting this issue. It is indeed a bug in RB. I pushed a fix in version 3.8.0-SNAPSHOT. Can you give it a try and let me know if it is ok for you? You can use the same syntax as in your example and it should work fine now (cda1de5 contains a similar example I used to test the fix).
I'm closing this issue, the fix will be part of the upcoming v3.8 release.
@ashbike Please consider giving your feedback with the released version, if you still have any problem, please re-open this issue. Thank you for reporting this out!
Thanks for the great work! I really liked this library and planning to use in our project. One question I had was, how to correctly write the following with RandomizerArgument annotation:
This does not work ofcourse and says Caused by:
I was wondering how to pass a textual representation of String array... any clue?
The text was updated successfully, but these errors were encountered: