Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Implement helper methods to reduce looping and struct accessor unwieldiness #33

@anweiss

Description

@anweiss

When creating OSCAL structs from various data sources, there can often be a number of unwieldy looping and struct accessor lines. Even creating a simple control with a single string narrative requires an unnecessary number of lines of code. Instead, we should provide helper methods that make it easy to go from simple strings to various OSCAL components (e.g. Parts, Prose, etc). So for example:

func NewPart(narrative string) catalog.Part {
	return catalog.Part{
		Prose: &catalog.Prose{
			P: []catalog.P{
				{Raw: narrative},
			},
		},
	}
}

Helpers should be created for reading nested information as well so as to avoid unwieldy iteration constructs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions