INNER CODE UNIT · Python

oscal_validator

usnistgov/OSCAL · src/utils/oscal-content-validator.py:46

def oscal_validator(oscal_schema, oscal_data):
    schema, stype = read_file(oscal_schema, _get_oscal_file_type(oscal_schema))
    data, ftype = read_file(oscal_data, _get_oscal_file_type(oscal_data))

    if ftype == 'json' or ftype == 'yaml':
        # Yaml files are validated using the json schema
        validate(data, schema)
    if ftype == 'xml':
        xmlschema.validate(data, schema)


def main():
    args = parse_args()

    oscal_validator(args.oscal_schema, args.oscal_file)


if __name__ == "__main__":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…