Skip to content

fix: accept whole numbers for the formats float and double - #133

Merged
pk-work merged 1 commit into
5.1from
downport_51
Aug 9, 2026
Merged

fix: accept whole numbers for the formats float and double#133
pk-work merged 1 commit into
5.1from
downport_51

Conversation

@pk-work

@pk-work pk-work commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The formats float and double define the precision of a number, not its representation. Jackson parses JSON numbers without a decimal part into Integer or Long, so values like 10 were rejected with 'Number does not match the format' although they are valid numbers with float or double precision.

Whole numbers are now accepted for the formats float and double, as long as they can be represented exactly with the related precision (2^24 for float, 2^53 for double). The behaviour for all other instance types is unchanged.

Fixes #112

(cherry picked from commit a2e2dc1)

Motivation:

Explain here the context, and why you're making that change, what is the problem you're trying to solve.

Conformance:

You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines

The formats float and double define the precision of a number, not its
representation. Jackson parses JSON numbers without a decimal part into
Integer or Long, so values like 10 were rejected with 'Number does not
match the format' although they are valid numbers with float or double
precision.

Whole numbers are now accepted for the formats float and double, as long
as they can be represented exactly with the related precision (2^24 for
float, 2^53 for double). The behaviour for all other instance types is
unchanged.

Fixes #112

(cherry picked from commit a2e2dc1)
@pk-work
pk-work merged commit cbf4d72 into 5.1 Aug 9, 2026
5 checks passed
@pk-work
pk-work deleted the downport_51 branch August 9, 2026 20:46
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

Successfully merging this pull request may close these issues.

2 participants