Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cmd/laas/gen_external_ref_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ package main
import (
"errors"
"fmt"
"log"
"os"

"path/filepath"

"github.com/dave/jennifer/jen"
logger "github.com/fossology/LicenseDb/pkg/log"
"go.uber.org/zap"
"gopkg.in/yaml.v3"
)

Expand All @@ -41,12 +42,12 @@ func main() {

fieldsMetadata, err := os.ReadFile(PATH_EXTERNAL_REF_CONFIG_FILE)
if err != nil {
log.Fatalf("Failed to instantiate json schema for external ref in license: %v", err)
logger.LogFatal("Failed to instantiate json schema for external ref in license", zap.Error(err))
}

err = yaml.Unmarshal(fieldsMetadata, &externalRefFields)
if err != nil {
log.Fatalf("Failed to instantiate json schema for external ref in license: %v", err)
logger.LogFatal("Failed to instantiate json schema for external ref in license", zap.Error(err))
}

// REUSE-IgnoreStart
Expand Down Expand Up @@ -74,7 +75,7 @@ func main() {
err = fmt.Errorf("type %s in external_ref_fields.yaml is not supported", f.Type)
}
if err != nil {
log.Fatalf("Failed to instantiate json schema for external ref in license: %v", err)
logger.LogFatal("Failed to instantiate json schema for external ref in license", zap.Error(err))
return
}
field = field.Tag(map[string]string{"json": fmt.Sprintf("%s,omitempty", f.Name), "swaggerignore": "true"})
Expand Down
Loading