-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Additional properties for describing restrictions on number values #602
Comments
Request to amend the proposal such that the following formats are valid:
This corresponds to a true arbitrary precision number. This is also a plain old JSON "number" type according to the JSON specification. It is basically equivalent to the java.lang.BigDecimal type with the caveat that BigDecimal supports at most 2,147,483,647 digits to the right of the decimal point.
This corresponds to a FixedPoint number. The Scala Spire library has a FixedPoint type. CC: @non he has a lot of experience working with weird number types. |
Would we want to explicitly state variable/unlimited precision or scale, or would this rather be expressed by not stating a finite precision or scale? The latter would be in style with |
I'd like to have a special value ('variable', 'unlimited', not picky on the name) that can be used to explicitly document unlimited precision or scale. Do the fields 'precision' and 'scale' only apply when 'type' is number and 'format' is decimal? Do they also apply when 'type' is number and 'format' is unspecified? I think at one point I understood the difference between (number, decimal) and (number, not specified) but I can't recall now. What is the difference? |
Good questions! Similar to Given the issues mentioned in #704 they might also apply to The intention of |
Tackling PR: #741 |
We've opted for "vendor-specific" extension keywords |
Sometimes the data provided or accepted by an API ultimately resides in a (relational) database, and most databases have a NUMBER type that allows storing numbers with decimal mantissa. The potential values of a NUMBER column are restricted by
This can of course be expressed with
minimum
,maximum
, andmultipleOf
, e.g.Yet it would be nicer to just say
This could also be used for DECFLOAT values:
is a long DECFLOAT, the short one would have
precision: 16
The text was updated successfully, but these errors were encountered: