oscal-cli icon indicating copy to clipboard operation
oscal-cli copied to clipboard

Metaschema Schema Gen Subcommand Throws Error unless `--as` argument is specified

Open nikitawootten-nist opened this issue 1 year ago • 4 comments

Describe the bug

Calling the metaschema schema gen subcommand throws a runtime error:

An uncaught runtime error occured. Cannot invoke "String.toUpperCase(java.util.Locale)" because "toFormatText" is null

Who is the bug affecting?

Those using the oscal-cli metaschema generate-schema subcommand

What is affected by this bug?

User DX

When does this occur?

When running the oscal-cli metaschema generate-schema subcommand without the --as argument.

How do we replicate the issue?

metaschema-xslt on  upstream_develop:develop [!?] 
 ➜ nix run github:nikitawootten/infra#oscal-cli -- metaschema generate-schema src/testing/models_metaschema.xml output.json
An uncaught runtime error occured. Cannot invoke "String.toUpperCase(java.util.Locale)" because "toFormatText" is null
metaschema-xslt on  upstream_develop:develop [!?] 
 ✗ nix run github:nikitawootten/infra#oscal-cli -- metaschema generate-schema src/testing/models_metaschema.xml --as=json output.json
Loading metaschema 'file:///Users/naw2/Documents/repos/metaschema-xslt/src/testing/models_metaschema.xml'
Generating JSON schema for 'src/testing/models_metaschema.xml'.
Generated JSON schema file: /Users/naw2/Documents/repos/metaschema-xslt/output.json

Expected behavior (i.e. solution)

The --as argument to be inferred, or a clear error requiring the user to specify it.

nikitawootten-nist avatar Nov 30 '23 18:11 nikitawootten-nist