Skip to content

Commit

Permalink
json-schema-org#1113 added validation of multipleof
Browse files Browse the repository at this point in the history
  • Loading branch information
akshat09867 committed Dec 27, 2024
1 parent 96729e9 commit 961a51b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"postcss": "^8.4.41",
"prettier": "3.3.3",
"tailwindcss": "^3.3.5",
"typescript": "5.7.2",
"typescript": "~5.3.0",
"webpack": "^5.94.0"
},
"babel": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1745,12 +1745,9 @@ <h4 id="name-multipleof">
A numeric instance is valid only if division by this keyword's value results in
an integer.<a href="#section-6.2.1-2" class="pilcrow"></a></p>
<p id="section-6.2.1-2">
Limitations:Using a floating-point value for 'multipleOf' may lead to inconsistent validation results due to binary precision issues.
Consider using scaled integers instead.<a href="#section-6.2.1-2" class="pilcrow"></a></p>
<p id="section-6.2.1-2">
Solution: Avoid using floating-point numbers with 'multipleOf' due to potential precision issues. For example, use scaled integers (e.g., represent $4.02 as 402 and 'multipleOf' as 1).
If using floating point then use Floating-point-friendly numbers (like 0.05) as it will reduce the chance of
precision issues but are still less reliable than integers.<a href="#section-6.2.1-2" class="pilcrow"></a></p>
To ensure consistent validation:
- Use scaled integers (e.g., represent $4.02 as 402 with 'multipleOf: 1')
- If floating-point values are necessary, use binary-friendly numbers (e.g., 0.5, 0.25, 0.125)</p><a href="#section-6.2.1-2" class="pilcrow"></a></p>
</section>
<section id="section-6.2.2">
<h4 id="name-maximum">
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8349,7 +8349,7 @@ __metadata:
slate-react: "npm:^0.108.0"
slugify: "npm:^1.6.5"
tailwindcss: "npm:^3.3.5"
typescript: "npm:5.7.2"
typescript: "npm:~5.3.0"
webpack: "npm:^5.94.0"
yarn: "npm:1.22.22"
zero-fill: "npm:^2.2.4"
Expand Down Expand Up @@ -11588,23 +11588,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.7.2":
version: 5.7.2
resolution: "typescript@npm:5.7.2"
"typescript@npm:~5.3.0":
version: 5.3.3
resolution: "typescript@npm:5.3.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/a873118b5201b2ef332127ef5c63fb9d9c155e6fdbe211cbd9d8e65877283797cca76546bad742eea36ed7efbe3424a30376818f79c7318512064e8625d61622
checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>":
version: 5.7.2
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=74658d"
"typescript@patch:typescript@npm%3A~5.3.0#optional!builtin<compat/typescript>":
version: 5.3.3
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/c891ccf04008bc1305ba34053db951f8a4584b4a1bf2f68fd972c4a354df3dc5e62c8bfed4f6ac2d12e5b3b1c49af312c83a651048f818cd5b4949d17baacd79
checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500
languageName: node
linkType: hard

Expand Down

0 comments on commit 961a51b

Please sign in to comment.