usnistgov/oscal-cli

YAML Null `~` Values Cause Hangs in OSCAL YAML Validation

aj-stein-nist opened this issue · 1 comments

Describe the bug

When using OSCAL CLI 0.3.1 and attempting to validate an assessment result in OSCAL YAML format, when I bind a variable to the null value, the CLI tool will hang and not emit an error, even if Metaschema does not allow/support elements with null values.

Who is the bug affecting?

OSCAL tool developers trying to write tools dynamically generating AP/AR document instances with conditional fields that may have no values or children values where constraints do not permit empty lists/arrays.

What is affected by this bug?

Validation of OSCAL YAML document instances, primarly assessment results for a soon to be released case study project

When does this occur?

Consistently.

How do we replicate the issue?

{What are the steps to reproduce the behavior?

  1. Install and configure oscal-cli version 0.3.1
  2. Run the following command oscal-cli ar validate --as=yaml path/to/example_ar_nullvar-[1,2,3].yaml with the following files.

If applicable, add screenshots to help explain your problem.}

Expected behavior (i.e. solution)

An error message is returned indicating null values or not supported, or some fail fast mechanism the CLI does not hang.

Other Comments

N/A

This potentially is an issue with metaschema-java and its YAML handling. I will review with the maintainer and if an issue does not currently exist, I will file one.