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

Add support to parse oscal document #17

Merged
merged 1 commit into from
May 16, 2023
Merged

Add support to parse oscal document #17

merged 1 commit into from
May 16, 2023

Conversation

abunashir
Copy link
Member

@abunashir abunashir commented May 6, 2023

This commit adds base support to parse an OSCAl document, this also provides a simplified way to get the ascidoc parsed into a structured YAML document. To parse any oscal document we can use the following.

Coradoc::Oscal.parse_to_yaml(sample_oscal_adoc)

@ronaldtse
Copy link
Contributor

@abunashir we should update the oscal gem and republish the latest version for the coradoc-oscal functionality to work

oscal.yml Outdated
- !ruby/object:Oscal::Control
id: cls_5.1
props:
- !ruby/object:Oscal::Property
Copy link
Contributor

Choose a reason for hiding this comment

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

@abunashir is it possible to remove the Ruby class designator here? I thought we just need to call Oscal::Catalog.to_yaml and the YAML file would not contain classes.

This is a "defined YAML structure" for OSCAL, we cannot change it by inserting Ruby-specific content.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is possible, but I assume we have to fix the to_yaml issue in Oscal and their Objects. For now, I just double transformed the doc and that should fix the issue for now. But, we definitely have to fix that soonish.

Copy link
Contributor

@ronaldtse ronaldtse May 14, 2023

Choose a reason for hiding this comment

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

Yes we will need to update the to_yaml methods in the OSCAL gem. The back is okay for now. Thanks.

This is the task:

Copy link
Contributor

Choose a reason for hiding this comment

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

I can verify that the hack works. Thanks.

oscal.yml Outdated Show resolved Hide resolved
This commit adds base support to parse an OSCAl document, this
also provides a simplified way to get the ascidoc parsed into
a structured YAML document. To parse any oscal document we can
use the following.

```ruby
Coradoc::Oscal.parse_to_yaml(sample_oscal_adoc)
```
@abunashir abunashir changed the title WIP: Extract out section block parsing Add support to parse oscal document May 16, 2023
@abunashir abunashir merged commit 406f1f7 into main May 16, 2023
@abunashir abunashir deleted the oscal-coradoc branch May 16, 2023 13:51
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