Skip to content

Floating point issues (multipleOf) #666

Closed
@buti1021

Description

@buti1021

Hey,
I have issues with multiple of validation. I guess it is to floating point inaccuracy. Is there any fix / workaround.

The following schema schould be valid but is not.

Schema: `{
"type": "object",
"required": [
"environ_impact"
],
"properties": {
"environ_impact": {
"type": "array",
"items": {
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"type": "number",
"minimum": 0,
"multipleOf": 0.0001
}
}
}

}
}
}`

JSON

`{
"type": "object",
"required": [
"environ_impact"
],
"properties": {
"environ_impact": {
"type": "array",
"items": {
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"type": "number",
"minimum": 0,
"multipleOf": 0.0001
}
}
}

}
}
}`

Thanks,

buti

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions