Skip to content
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

Add a DeserializationFeature.FAIL_ON_TRAILING_TOKENS to force reading of the whole input as single value #1583

Closed
cowtowncoder opened this issue Mar 30, 2017 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: multiple ancestor issues, f.ex #1494 -- quite commonly requested, even if indirectly)

Users would often prefer to ensure that the whole input stream would be consumed for data-binding so that error would be signaled if: there are "leftover" tokens after valid content: { } 3, or, specifically, if the whole taken into account is invalid:

"key" : 4

where just "key" would be valid JSON String, but when reading further parser detects malformed content where presumably curly braces are missing.

Now: although support for such "full reads" could be handled using multiple means -- for example, by exposing, say, readFullValue() as alternative to readValue() -- it seems preferable to use a feature to support use-cases where developer does not control method called: this is often the case when using Jackson via framework like a JAX-RS implementation. If so, dev may be able to pre-configure ObjectMapper with suitable settings to affect change in reading behavior.

@cowtowncoder cowtowncoder added this to the 2.9.0 milestone Jul 19, 2017
@cowtowncoder cowtowncoder changed the title Add a DeserializationFeature to force reading of whole stream as single value Add a DeserializationFeature.FAIL_ON_TRAILING_TOKENS to force reading of whole stream as single value Jul 19, 2017
@cowtowncoder cowtowncoder changed the title Add a DeserializationFeature.FAIL_ON_TRAILING_TOKENS to force reading of whole stream as single value Add a DeserializationFeature.FAIL_ON_TRAILING_TOKENS to force reading of the whole input as single value Jul 19, 2017
cowtowncoder added a commit that referenced this issue Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant