Skip to content

Using min in a precision range results in an InvalidSchemaException #239

@popematt

Description

@popematt

E.g.:

$ion_schema_2_0
type::{
  name: foo,
  precision: range::[min, 5]
}

Results in:

Precision must be at least 1 (range::[min,4])
com.amazon.ionschema.InvalidSchemaException: Precision must be at least 1 (range::[min,4])
	at com.amazon.ionschema.internal.constraint.Precision.<init>(Precision.kt:33)
        ...

The spec says that any positive int range is okay for precision, so the precision constraint should be interpreting min as 1 rather than 0.

This issue affects all versions of ISL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions