Skip to content

Conversation

@VinnyBarton
Copy link
Collaborator

Returning a full ValidationResult object

// ValidationResult represents the outcome of validating a Software Bill of Materials (SBOM).
//
// It provides detailed information about the validation process, including:
//   - Whether the SBOM is valid (`IsValid`).
//   - The detected SBOM type (e.g., CycloneDX, SPDX).
//   - The SBOM schema or specification version.
//   - A list of any validation errors encountered.
//   - The schema file or source used during validation.
//   - The detected input format (e.g., JSON, XML, etc.).
//
// This struct is returned by `ValidateSBOMData` and can be serialized to JSON
// for use in CLI tools, APIs, or automated pipelines.
type ValidationResult struct {
	IsValid          bool     `json:"isValid"`
	SBOMType         string   `json:"sbomType,omitempty"`
	SBOMVersion      string   `json:"sbomVersion,omitempty"`
	ValidationErrors []string `json:"validationErrors,omitempty"`
	SchemaUsed       string   `json:"schemaUsed,omitempty"`
	DetectedFormat   string   `json:"detectedFormat,omitempty"`
}

Previously only a bool was being returned

@VinnyBarton VinnyBarton merged commit a9c7e40 into main Oct 28, 2025
4 checks passed
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