-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
PrimitiveArrayDeserializers
should deal with single String value if DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY
enabled
#4650
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
Comments
hi, just wondering if this is a sensible request for enhancement? I believe it'd be fine in terms of backwards compatibility too, I am happy to raise a PR if that's ok |
@eeren-bm Yes, I think PR would make sense -- including tests to verify that handling for primitive arrays works as expected. |
Ah. The challenge here is that it's not a single Number to wrap, but a JSON String that happens to contain number. Hmmmh. If it works for @eeren-bm If you are still interested, PR would be welcome. |
hi created #5022, hope that's good |
PrimitiveArrayDeserializers
should deal with single String value if DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY
enabled
Thank you @eeren-bm ! I added some tweaks but fundamentally we are good to go! |
@cowtowncoder Have we received CLA from our contributor here? Seems new |
@JooHyukKim Thank you for reminder (good catch!). |
@eeren-bm I forgot to ask first, but we do need a CLA. It's 1-page document from: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf (just needed once, before merging the first PR -- good for all future contributions) The usual way is to print it, fill & sign, scan/photo, email to Apologies for forgetting to ask for this first: but we do need it. I won't revert the PR at this point, I assume we can get this resolved. :) |
@cowtowncoder yeah probably no biggies. If we are not reverting this then let's at least ask and get physical answer? @eeren-bm Are u okay to cover this merged PR to be in scope with the CLA u would be submitting? No biggies but procedural thing to stay open source :) |
@JooHyukKim what I mean(t) by "not reverting" was just that let's see if we can get CLA first -- without it need to revert, but let's not do that unless we must. So "not revert yet". |
thanks, I have sent it across, let me know if it's all good =] |
@eeren-bm Thank you -- I got it, all good @JooHyukKim As per above we are good. Thank you for reminder! |
Discussed in #4649
Originally posted by eeren-bm July 25, 2024
I think there's a bit of asymmetry when the lib is used to deserialized into primitive array vs List of objects. Please see the below example
The commented lines are lines I would expect to generate the similar results as List without throwing exceptions.
I believe the simple fix is to remove below lines from
PrimitiveArrayDeserializers
class'handleNonArray()
methodas they would almost certainly throw exception as
getValueInstantiator()
method is not being overriden to generate a sensible result. And a single string value will be dealt with correctly without above lines.Thanks for looking ! Please kindly let me know your thoughts
The text was updated successfully, but these errors were encountered: