Skip to content

Jackson2Tokenizer ignores USE_BIG_DECIMAL_FOR_FLOATS deserialization feature #22510

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

Closed
ilya-murzinov opened this issue Mar 5, 2019 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@ilya-murzinov
Copy link

ilya-murzinov commented Mar 5, 2019

Affects: spring-web-5.1.3.RELEASE


In org.springframework.http.codec.json.Jackson2Tokenizer ctor TokenBuffer is created without passing DeserializationContext inside com.fasterxml.jackson.databind.util.TokenBuffer. This leads to USE_BIG_DECIMAL_FOR_FLOATS being ignored when parsing.

private Jackson2Tokenizer(JsonParser parser, boolean tokenizeArrayElements) {
    Assert.notNull(parser, "'parser' must not be null");

    this.parser = parser;
    this.tokenizeArrayElements = tokenizeArrayElements;
    this.tokenBuffer = new TokenBuffer(parser); // <--- here
    this.inputFeeder = (ByteArrayFeeder) this.parser.getNonBlockingInputFeeder();
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 5, 2019
@jhoeller jhoeller self-assigned this Mar 5, 2019
@jhoeller jhoeller added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 5, 2019
@jhoeller jhoeller added this to the 5.1.6 milestone Mar 5, 2019
@ilya-murzinov
Copy link
Author

ilya-murzinov commented Apr 9, 2019

@jhoeller unfortunately this issue is not fixed, see f6693e7#r33105391

@ilya-murzinov
Copy link
Author

this issue is still reproducible in spring-web-5.1.6.RELEASE

@jhoeller jhoeller reopened this Apr 9, 2019
@jhoeller jhoeller added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Apr 9, 2019
@jhoeller jhoeller modified the milestones: 5.1.6, 5.1.7 Apr 9, 2019
@jhoeller
Copy link
Contributor

jhoeller commented Apr 9, 2019

I've revised this to create a fully configured DefaultDeserializationContext within the tokenizer, analogous to Jackson's own standard code paths. This will make it into 5.2 M1 tomorrow and into 5.1.7 in early May.

@ilya-murzinov
Copy link
Author

ilya-murzinov commented Apr 11, 2019

Thanks @jhoeller, I've just tested your change and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants