Skip to content

support negative multiples#1089

Merged
Stranger6667 merged 1 commit intoStranger6667:masterfrom
ostrowr:dev/robbie/negative-multipleof
Apr 6, 2026
Merged

support negative multiples#1089
Stranger6667 merged 1 commit intoStranger6667:masterfrom
ostrowr:dev/robbie/negative-multipleof

Conversation

@ostrowr
Copy link
Copy Markdown
Contributor

@ostrowr ostrowr commented Apr 5, 2026

According to the spec, it's perfectly valid for a negative number to be a multipleOf a positive one:

https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.6.2.1

[6.2.1.](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.6.2.1) multipleOf
The value of "multipleOf" MUST be a number, strictly greater than 0.

A numeric instance is valid only if division by this keyword's value results in an integer.

-6 / 1.5 is an integer!

I've also opened an issue in JSON-Schema-Test-Suite to exercise this case:

json-schema-org/JSON-Schema-Test-Suite#888

Copy link
Copy Markdown
Owner

@Stranger6667 Stranger6667 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.50%. Comparing base (8acb9de) to head (4ffd458).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1089   +/-   ##
=======================================
  Coverage   94.50%   94.50%           
=======================================
  Files          81       81           
  Lines       22610    22610           
=======================================
  Hits        21367    21367           
  Misses       1243     1243           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 6, 2026

Merging this PR will not alter performance

✅ 68 untouched benchmarks


Comparing ostrowr:dev/robbie/negative-multipleof (4ffd458) with master (8acb9de)

Open in CodSpeed

@Stranger6667 Stranger6667 merged commit 9265f70 into Stranger6667:master Apr 6, 2026
73 of 75 checks passed
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