Skip to content

Validation of optional fields referring to choices inappropriately fails #139

@whimboo

Description

@whimboo

Trying to validate the following JSON file against the given CDDL definition fails. As it looks like there is a problem with the optional occurrence indicator (including *, + as well) because removing it will succeed the validation.

{
  "name": "foo",
  "valid": "no"
}
Argument = {
  name: text,
  ?valid: "yes" / "no"
}

The visible failure:

[ERROR] Validation of "data.json" failed: error validating type choice at the root of the JSON document: unexpected key "valid"

Removing the question mark it succeeds:

[INFO] Validation of "data.json" is successful

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions