Skip to content

Excluding and defining rules for missing fields #117

@martonvago

Description

@martonvago

Missing fields are a special case for rules and exclusions because they are not in the object.

Let's say we have the resource

{
    # "name": "woolly-dormice-2015",
    "title": "Body fat percentage in the hibernating woolly dormouse",
    "path": "resources/woolly-dormice-2015/data.parquet",
    # "version": "1.0.0",
}
  • If version is missing, I can't define a rule for it, not even a "version must exist" rule. This is because there is nothing to apply the rule to.
    • Solution: apply it to None
  • If name, a required field, is missing, I can't exclude it with jsonpath="...name" because it is not in the descriptor.
    • Solution: handle excluding required issues separately in a few lines of code

It wouldn't be very difficult to support these use cases. Should we?

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions