Skip to content

Commit

Permalink
feat: Improve local testing by allowing to e.g. disable jxscm, whil…
Browse files Browse the repository at this point in the history
…e letting the configuration be loaded without issue even if using `debug` instead of `jxscm`
  • Loading branch information
keskad committed May 23, 2024
1 parent e2c50a4 commit 7a28dcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/config/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

type SchemaValidator struct {
Debug bool
schema map[string]Schema
}

Expand All @@ -20,6 +21,9 @@ func (sm *SchemaValidator) Add(schema Schema) {

func (sm *SchemaValidator) ValidateRequestedEntry(group string, key string) error {
if _, exists := sm.schema[group]; !exists {
if sm.Debug {
return nil
}
return errors.New(fmt.Sprintf("component '%s' has no registered its schema", group))
}
grp := sm.schema[group]
Expand Down

0 comments on commit 7a28dcf

Please sign in to comment.