Skip to content
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

use JSON Serialization to provide the value returned by the metaquery #24

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

wandmagic
Copy link
Collaborator

No description provided.

Comment on lines -165 to +163
cmdLine.hasOption(CONTENT_OPTION) -> {
LOGGER.warn("Content option provided without Metaschema option")
return ExitCode.INVALID_ARGUMENTS.exitMessage(
"Must use '${CONTENT_OPTION.argName}' to specify the Metaschema module."
)
}
else -> {
LOGGER.info("No Metaschema or Content option provided")
Pair(null, null)
LOGGER.info("No Content option provided")
null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: in some cases this should work, there has been a regression potentially. FYSA:

metaschema-framework/metaschema-java#228

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pursue this in another PR, but this is good to know, so a metapath just executing inline?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pursue this in another PR

Agreed, feel free to resolve.

but this is good to know, so a metapath just executing inline?

Correct, when there are lower-level syntax errors, I actually use this, you may have noticed I also use it during our pairing sessions, the local API approach will make it much faster. 😉

% oscal-cli --version                                                  
oscal-cli 2.2.0 built at 2024-10-08 23:48 from branch 0b9478792d27837a8967cc72a0c98776b24f7102 (0b94787) at https://github.com/metaschema-framework/oscal-cli
liboscal-java  built at 2024-10-08 22:12 from branch 0e7de882592dedef37a1fc30101393e6c4fe71f3 (0e7de88) at https://github.com/metaschema-framework/liboscal-java
oscal v1.1.2 built at 2024-10-08 22:12 from branch 4f02dac6f698efda387cc5f55bc99581eaf494b6 (4f02dac) at https://github.com/usnistgov/OSCAL.git
metaschema-java 1.2.0 built at 2024-10-08T20:00:42+0000 from branch 46df8d8fc25c5de1d7cb0485e534f31efe61b2b7 (46df8d8) at https://github.com/metaschema-framework/metaschema-java
metaschema  built at 2024-10-08T20:00:42+0000 from branch 7c03ce5844e46cf9d047193a37e44422ae6a7d61 (7c03ce5) at https://github.com/metaschema-framework/metaschema.git
% oscal-cli metaschema metapath eval -e "2 * 2"
4

I use this to check syntax before/with constraint authoring. This found some bugs with the output wrapping with sequence () and other output weirdness in #228.

@wandmagic wandmagic merged commit bb71af4 into main Oct 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants