Skip to content

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

@nikitawootten-nist

Description

@nikitawootten-nist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Blocked

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions