FasterXML / jackson-core

Core part of Jackson that defines Streaming API as well as basic shared abstractions
Apache License 2.0
2.25k stars 773 forks source link

Add new `StreamReadConstraints` (`maxTokenCount`) to limit maximum number of Tokens allowed per document #1310

Closed cowtowncoder closed 2 months ago

cowtowncoder commented 2 months ago

As discussed in https://github.com/FasterXML/jackson/discussions/231#discussioncomment-9603279 it would be useful to allow limiting of input content as indicated by number of tokens -- in addition to already existing limits as of Jackson 2.17 (maximum length in bytes/chars; maximum nesting depth; maximum property name length; maximum number/text token lengths).

cowtowncoder commented 2 months ago

Fixed via #1296: will be in 2.18.0