Skip to content

Accept numeric integer schema bounds#250

Closed
leehack wants to merge 1 commit into
spec/default-2026-discoveryfrom
spec/integer-schema-number-bounds
Closed

Accept numeric integer schema bounds#250
leehack wants to merge 1 commit into
spec/default-2026-discoveryfrom
spec/integer-schema-number-bounds

Conversation

@leehack

@leehack leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • widen JsonInteger numeric keywords and default values from int-only to num
  • preserve fractional integer schema bounds/defaults during JSON schema parsing and serialization
  • keep integer instance validation strict while allowing fractional multipleOf constraints

Spec evidence

  • Official draft and 2025-11-25 JSON schemas define RequestId/ProgressToken as integer, but NumberSchema numeric keywords for integer schemas use JSON number values.
  • Draft changelog notes schema JSON now reflects minimum/maximum/default as numbers rather than only integers.

Validation

  • dart format lib/src/shared/json_schema/json_schema.dart lib/src/shared/json_schema/json_schema_validator.dart test/shared/json_schema_from_json_test.dart test/shared/json_schema_validator_test.dart
  • dart test test/shared/json_schema_from_json_test.dart test/shared/json_schema_validator_test.dart
  • dart analyze
  • git diff --check
  • dart test
  • (packages/mcp_dart_cli) dart run bin/mcp_dart.dart conformance --suite all --json

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.48%. Comparing base (52f0c9c) to head (15a5d14).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           spec/default-2026-discovery     #250   +/-   ##
============================================================
  Coverage                        88.48%   88.48%           
============================================================
  Files                               47       47           
  Lines                             9353     9353           
============================================================
  Hits                              8276     8276           
  Misses                            1077     1077           
Flag Coverage Δ
unittests 88.48% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leehack

leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft micro PR because the RC spec work has been consolidated into a smaller reviewable stack. This change is preserved in #271 (type/schema validation); the consolidated tip is tree-identical to the previous micro-stack tip.

@leehack leehack closed this Jun 1, 2026
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