-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change default of DeserializationFeature.FAIL_ON_TRAILING_TOKENS
to true
for 3.0
#3406
Comments
Have not yet decided but will include in "potentially for 3.0.0" list, will bring up on discussion (to be created). |
Though the rationale here makes sense (and the one from #3400), this seems to be have similar aspects to #493 about So main opposing idea would be the Postel's Law saying...
... at the moment I don't have strong opinion on either side yet. I wish we could invite over the same crowd from #493 for discussion 😅. |
FAIL_ON_TRAILING_TOKENS
to true
for 3.0DeserializationFeature.FAIL_ON_TRAILING_TOKENS
to true
for 3.0
See discussion at FasterXML/jackson-future-ideas#74 wrt whether to make proposed change in 3.0.0. |
Proposal approved: can proceed with this change. |
Ok: trying to work through PR shows a few issues -- initially about 30 unit test failures, of which only 2 are for specific checking of configuration settings. I have been able to resolve about 2/3 of them, leaving (as of now) 11 failures. Will keep on working through them to get closer to 0. However: I am finding potential concerns about this change... will see how remaining failures look like, and will outline my concerns if some remain. |
Ok. So, all remaining 11 failures are actually weird, but due to same underlying issue: use of External Type Id leading to:
failures. This must be due to the way This suggests problem unrelated to
So will need to put this on hold for now, probably. :-/ |
Turns out issue was not as serious as I thought: odd error message is a flaw to fix via: but was triggered by erroneous JSON in test. Now merged: will see how many downstream test fails we get :) |
Wow. This change has been great for teasing out various bigger and smaller flaws on both core and format modules (last fix was for Protobuf backend that had regression in 3.0.0, only caught by trailing tokens check). Still got one remaining XML issue to eventually fix. |
imo it is better to fail by default here. If you're parsing line-delimited json, you'll notice immediately if you forget to turn off
FAIL_ON_TRAILING_TOKENS
. However in the other direction, if it was off by default and you forget to turn it on, you probably would never notice (few people test for failures), which could also open up the door to parsing differential vulnerabilities in an application.See discussion on #3400
The text was updated successfully, but these errors were encountered: