Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Validate JSON examples" reports issue for number fields with "multipleOf" #498

Closed
schneidermic0 opened this issue Feb 28, 2023 · 6 comments · Fixed by #499
Closed

"Validate JSON examples" reports issue for number fields with "multipleOf" #498

schneidermic0 opened this issue Feb 28, 2023 · 6 comments · Fixed by #499
Assignees

Comments

@schneidermic0
Copy link
Contributor

JSON schema validation fails for fields of "type": "number" with "multipleOf": 0.001.

See PR #497

@schneidermic0
Copy link
Contributor Author

See also python-jsonschema/jsonschema#1039

Maybe, an update to the latest version fixes the issue.

@schneidermic0
Copy link
Contributor Author

Still not working :(

@schneidermic0 schneidermic0 reopened this Feb 28, 2023
@albertmink
Copy link
Contributor

albertmink commented Feb 28, 2023

Maybe this is also a misinterpretation, see comment https://stackoverflow.com/a/54980033 (author is a JSON Schema guy, so don't be worried of the votes of the replay)

To be clear, comparing floats e.g. = is error prone. Not a defect of JSON Schema.

For the particular object type, maybe switch to string and do some regex, to get the validation.

@larshp
Copy link
Collaborator

larshp commented Mar 2, 2023

ajv-validator/ajv#652

@schneidermic0
Copy link
Contributor Author

We discussed the topic. We tend to remove the annotation multipleOf for fields specified with type p.

@schneidermic0
Copy link
Contributor Author

This issue was fixed by SAP/abap-file-formats-tools#230

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 a pull request may close this issue.

3 participants