-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metaschema Schema Gen Subcommand Throws Error unless --as
argument is specified
#227
Comments
Thanks, @nikitawootten-nist. I will open up a cross-ref issue metaschema-java, as this is an issue with its embedded metaschema-cli usage as a subcommand. |
Nevermind, I am going to hold off on that. Interesting, when running it on the WIP metaschema snapshot version, without embedding in oscal-cli, it seems to properly return a message saying $ tmpdir=$(mktemp -d)
$ pushd $tmpdir
$ curl -L -O https://oss.sonatype.org/content/repositories/snapshots/gov/nist/secauto/metaschema/metaschema-cli/1.0.0-M2-SNAPSHOT/metaschema-cli-1.0.0-M2-20231020.200351-14-metaschema-cli.zip
$ curl -L -O https://raw.githubusercontent.com/usnistgov/metaschema-xslt/develop/src/testing/models_metaschema.xml
$ ./bin/metaschema-cli generate-schema models_metaschema.xml
usage: metaschema-cli generate-schema --as=FORMAT [<options>] <metaschema-module-file> [<destination-schema-file>]
--as=<FORMAT> source format: xml, json, or yaml
-h,--help display this help message
--inline-types definitions declared inline will be generated as inline types
--no-color do not colorize output
--overwrite overwrite the destination if it exists
-q,--quiet minimize output to include only errors
--show-stack-trace display the stack trace associated with an error
--version display the application version
Missing required option: as
# Obviously giving it `--as=xml` makes it dump a ton of correct output. |
It appears after debugging and experimentation that As develop of metaschema-java is being used to prep an upcoming 1.0.0 of the framework library and the CLI, we cannot immediately test this due to dependency hell scenarios with maven enforcer plugin with varying versions of metaschema-java, liboscal-java, and oscal-cli (even when using the SNAPSHOT builds of the first two), but it looks like it was fixed upstream before the next release, but we need to wait on this. Thanks to @nikitawootten-nist for the help. |
This needs to be handled like usnistgov/metaschema-java#293 (comment), and that issue is tracking this fix. Will need handle it in that codebase and then update the dependency in here. |
Describe the bug
Calling the metaschema schema gen subcommand throws a runtime error:
Who is the bug affecting?
Those using the
oscal-cli metaschema generate-schema
subcommandWhat 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?
Expected behavior (i.e. solution)
The
--as
argument to be inferred, or a clear error requiring the user to specify it.The text was updated successfully, but these errors were encountered: