Skip to content

Is a fractional part of ".0" allowed for integers? #2977

Closed Answered by webron
mkauf asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you're referencing OpenAPI 3.0 which uses JSON Schema draft-6/draft-0. That version of JSON Schema does not have an integer data type. The definition was added since we moved from draft 4, which did have an integer definition, though otherwise the draft versions are pretty much identical.

Draft 06 does have some additional information about mathematical integers, and suggest not using a decimal point for integer values, even though it is technically supported.

Long story short, the fractional part is not allowed.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@webron
Comment options

@mkauf
Comment options

@jdesrosiers
Comment options

@webron
Comment options

@jdesrosiers
Comment options

Answer selected by mkauf
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #2976 on July 21, 2022 16:50.