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

Add test for multipleOf to ensure that implementation does not have an issue regarding scale

Open
#321 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
750
Forks
308
Avg merge
3d 17h
Merged PRs (30d)
24

Description

This is not a float/double related issue but is one regarding scale. Consider the following schema:

[
    {
        "description": "by deep scale",
        "schema": {"multipleOf": 0.25},
        "tests": [
            {
                "description": "8.75 is multiple of 0.25",
                "data": 8.75,
                "valid": true
            },
            {
                "description": "8.750000000001 is not multiple of 0.25",
                "data": 8.750000000001,
                "valid": false
            },
            {
                "description": "8.7500000000001 is not multiple of 0.25",
                "data": 8.7500000000001,
                "valid": false
            },
            {
                "description": "8.75000000000001 is not multiple of 0.25",
                "data": 8.75000000000001,
                "valid": false
            }
        ]
    }
]

This will ensure libraries with language support for a rich big decimal are not constrained by a low exponent check.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the test fixture containing multipleOf cases and review how numeric validation examples are organized. Add the provided deep-scale schema cases, then run the JSON Schema Test Suite checks to confirm 8.75 is valid while each more precise value is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.