SAP / abap-file-formats

File formats that define and specify the file representation for ABAP development objects
MIT License
58 stars 55 forks source link

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

Closed schneidermic0 closed 1 year ago

schneidermic0 commented 1 year ago

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

See PR #497

schneidermic0 commented 1 year ago

See also https://github.com/python-jsonschema/jsonschema/issues/1039

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

schneidermic0 commented 1 year ago

Still not working :(

albertmink commented 1 year ago

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 commented 1 year ago

https://github.com/ajv-validator/ajv/issues/652

schneidermic0 commented 1 year ago

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

schneidermic0 commented 1 year ago

This issue was fixed by https://github.com/SAP/abap-file-formats-tools/pull/230