Skip to content

Keep numeric assertions from rejecting boolean instances - #92

Merged
quinnj merged 1 commit into
masterfrom
maintenance/jsonschema-bool-numeric
Oct 4, 2026
Merged

quinnj merged 1 commit into
masterfrom
maintenance/jsonschema-bool-numeric

Conversation

@quinnj

@quinnj quinnj commented Oct 4, 2026

Copy link
Copy Markdown
Member

A schema such as {"maximum": 0} rejected true, even though numeric assertions apply only to JSON numbers. Julia's Bool <: Number sent 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.

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.
@quinnj
quinnj merged commit b868918 into master Oct 4, 2026
7 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.

1 participant