Repository navigation
Keep numeric assertions from rejecting boolean instances - #92
Merged
Merged
Conversation
Exclude Bool instances from numeric assertion methods, including draft-4 boolean exclusive limits. Julia's Bool subtype relation does not make a JSON boolean a number. Numeric constraints and explicit type checks retain their existing behavior. AI disclosure: This work was prepared with assistance from OpenAI Codex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A schema such as
{"maximum": 0}rejectedtrue, even though numeric assertions apply only to JSON numbers. Julia'sBool <: Numbersent booleans through all five numeric validators. Add an early boolean return in those methods, including the draft-4 boolean forms of exclusive limits.The 118 public regression checks cover true/false at the root, in object properties and array items, explicit boolean and number types, numeric boundary controls, older exclusive limits, and composition. Unchanged master passes 85 checks and fails 33; the candidate passes all 118 on Julia 1.9.4 and 1.13.1. Both full package suites and the latest JuliaFormatter check pass.
The behavior follows draft-7 validation sections 3.2.1 and 6.2.
Co-authored by Codex
AI disclosure: This work was prepared with assistance from OpenAI Codex.