Open pjfanning opened 1 year ago
My first instinct is that I disagree, mostly from complexity of implementation. Keeping in mind that not checking this is a requirement for root-level value streaming (like line-separated JSON).
The way things are implemented I am not even sure where we would be forcing this.
I guess one possibility would be that if a feature was enabled, check was made on close()
... and if (but only if!) document is completely read, next token would fail.
Compared to trying to do this at streaming level, support from databind is almost trivial: after binding full value verify that parser.nextToken()
returns null
.
jackson-core equivalent of https://javadoc.io/static/com.fasterxml.jackson.core/jackson-databind/2.15.2/com/fasterxml/jackson/databind/DeserializationFeature.html#FAIL_ON_TRAILING_TOKENS
It feels like jackson-core should support this too. Not just jackson-databind.