Skip to content

Add decimal place constraint to number fields #641

@ezwelty

Description

@ezwelty

I am rewriting and publishing an existing dataset as a Data Package (https://gitlab.com/ezwelty/glathida), and it includes decimal place limits on several numeric fields. For now, I have enforced this using a pattern constraint:

"pattern": "^\\-?[0-9]*(\\.[0-9]{0,7})?$"

Unfortunately, this practice violates the schema, which currently insists that pattern only apply to post-cast values of string fields (#428). I understand the complexity that is avoided by the decision, but also regret the huge potential for specificity that is lost. I wish pattern was applied to the field values as stored in the text file (csv, json, or otherwise).

Otherwise, I see no other option than adding a specific decimal place constraint for number fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions