Repository navigation
docs(585): numeric and integer schema fields use exact match by default - #588
Merged
digalaviz merged 1 commit intoNov 18, 2026
Merged
Conversation
…wslabs#585) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FzKMUk44AaHNFJtMUvE3D
vawsgit
approved these changes
Nov 17, 2026
vawsgit
left a comment
Contributor
There was a problem hiding this comment.
✅ LGTM!
I checked every claim in the changed text against the code on this head (7962e96a5f4484e3af2805dcd5565f83bd1f43bd), with stickler imported from this checkout's src/.
- Default comparator and threshold (README.md#L309-L312, Comparators/README.md#L529-L532): a plain
numberorintegerfield exportsNumericComparatorwith threshold0.5. Field names such astotal_amountorcountdo not change this. - "Exact match by default":
NumericComparatordefaultsrelative_toleranceandabsolute_toleranceto0.0. Measured: number 100 vs 100.01 scores 0.0, and integer 100 vs 101 scores 0.0. - New tolerance example (Comparators/README.md#L538-L545):
{"tolerance": 0.01}scores 100 vs 100.01 as 1.0, and it exports asabsolute_tolerance: 0.01.absolute_toleranceandrelative_tolerancegive the same result. Setting onlyx-aws-stickler-comparator-config, with no comparator named, applies to the defaultNumericComparator. - Scope: both tables cover only the JSON Schema path. The inference path (
stickler.evaluate,from_pydantic) does give floats a relative tolerance, and the guide already says the two paths do not share defaults. So no other page needs changing. A repo search for "tolerat" and "small numeric" found no other page that claims JSON Schema numbers tolerate differences by default. - Issue #585: both locations it names are fixed, and the one-line example it asks for is added with its 0.0 and 1.0 numbers.
Closes #585is correct. - PR body checks:
docs/check_links.pyexits 0, andtests/test_docs_build.pyplustests/test_readme_examples.pygive 88 passed. - Base: the merge-base equals current
dev, so the branch is up to date.
Non-blocking: no test runs the new JSON snippet. I checked it by hand.
Security Scan ResultsASH Security Scan Report
Scan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies:
Report generated by Automated Security Helper (ASH) at 2026-11-18T23:30:28+00:00 |
2 of 4 tasks
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.
Closes #585
Description of changes:
numberandintegerJSON Schema fields map toNumericComparator, whose default tolerance is 0, so they are an exact match by default. Two tables said they tolerate small differences.Files changed:
README.md: thenumberandintegerrows now say "Exact match unless a tolerance is set inx-aws-stickler-comparator-config".docs/docs/Guides/Comparators/README.md: same row fix, plus one example below the table:{"type": "number", "x-aws-stickler-comparator-config": {"tolerance": 0.01}}A plain
{"type": "number"}scores 100 vs 100.01 as 0.0; with tolerance 0.01 it scores 1.0 (verified against this checkout).toleranceis a backward compatibility alias forabsolute_toleranceinNumericComparator, so both keys behave the same.Checks:
docs/check_links.pyclean,ruff check .passes,tests/test_readme_examples.pyandtests/test_docs_build.py88 passed.🤖 Generated with Claude Code
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.