cyclonedx.validation.model
Classes
Severity level of a |
|
Validation failed with this specific error. |
|
Perform data-model level validations to make sure we have some known data integrity. |
Module Contents
- class cyclonedx.validation.model.ModelValidationErrorSeverity
Bases:
str,enum.EnumSeverity 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.ValidationErrorValidation failed with this specific error.
Use
datato access the content. Useseverityto 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
Bomat the data-model level.Yields
ModelValidationErrorinstances — one per issue found. Errors withERRORseverity indicate structural invalidity; errors withWARNINGseverity are advisory.This method has no side-effects: it does not mutate the
bompassed in.- Parameters:
bom – The
Bomto validate.- Returns:
An iterable of
ModelValidationErrorfor each issue found.