cyclonedx.validation.model

Classes

ModelValidationErrorSeverity

Severity level of a ModelValidationError.

ModelValidationError

Validation failed with this specific error.

ModelValidator

Perform data-model level validations to make sure we have some known data integrity.

Module Contents

class cyclonedx.validation.model.ModelValidationErrorSeverity

Bases: str, enum.Enum

Severity level of a ModelValidationError.

ERROR = 'error'

BOM is structurally invalid and cannot be serialized correctly.

WARNING = 'warning'

BOM may have issues but can still be serialized; attention is recommended.

class cyclonedx.validation.model.ModelValidationError(data: Any, severity: ModelValidationErrorSeverity = ModelValidationErrorSeverity.ERROR)

Bases: cyclonedx.validation.ValidationError

Validation failed with this specific error.

Use data to access the content. Use severity to determine how critical the issue is.

severity
class cyclonedx.validation.model.ModelValidator

Perform data-model level validations to make sure we have some known data integrity.

validate(bom: cyclonedx.model.bom.Bom) collections.abc.Iterable[ModelValidationError]

Validate a Bom at the data-model level.

Yields ModelValidationError instances — one per issue found. Errors with ERROR severity indicate structural invalidity; errors with WARNING severity are advisory.

This method has no side-effects: it does not mutate the bom passed in.

Parameters:

bom – The Bom to validate.

Returns:

An iterable of ModelValidationError for each issue found.