diff --git a/.vscode/launch.json b/.vscode/launch.json index 6c72c74..1a6c23f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,6 +15,16 @@ "args": ["validate", "-i", "examples/cyclonedx/SBOM/protonmail-webclient-v4-0912dff/bom.json"], "dlvFlags": ["--check-go-version=false"] }, + { + "showGlobalVariables": true, + "name": "Debug: validate", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "main.go", // "program": "${file}", + "args": ["validate", "-i", "examples/cyclonedx/SBOM/protonmail-webclient-v4-0912dff/bom.json"], + "dlvFlags": ["--check-go-version=false"] + }, { "showGlobalVariables": true, "name": "Debug: query: SELECT * FROM metadata.component", diff --git a/cmd/validate.go b/cmd/validate.go index c220d50..5dc25c3 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -253,8 +253,8 @@ func Validate(writer io.Writer, persistentFlags utils.PersistentCommandFlags, va return INVALID, bom, schemaErrors, errSchemaURI } - getLogger().Infof("Loading schema: '%s'...", schemaName) - schemaLoader = gojsonschema.NewReferenceLoader(schemaName) + getLogger().Infof("Loading schema: '%s'...", forcedSchemaFile) + schemaLoader = gojsonschema.NewReferenceLoader(forcedSchemaFile) getLogger().Infof("Validating document using forced schema (i.e., '--force %s')", forcedSchemaFile) } else { // Load the matching JSON schema (format, version and variant) from embedded resources