move schema package out of internal

This commit is contained in:
Joel Wetzell
2026-09-10 10:24:33 -05:00
parent 3217fa233e
commit 20aee7e50b
8 changed files with 2 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
package schema
import (
"fmt"
"net/url"
"github.com/google/jsonschema-go/jsonschema"
)
func GetResolvedConfigSchema() (*jsonschema.Resolved, error) {
return ConfigSchema.Resolve(&jsonschema.ResolveOptions{
Loader: func(uri *url.URL) (*jsonschema.Schema, error) {
switch uri.String() {
case "https://showbridge.io/modules.schema.json":
return GetModulesSchema(), nil
case "https://showbridge.io/processors.schema.json":
return GetProcessorsSchema(), nil
case "https://showbridge.io/routes.schema.json":
return &RoutesConfigSchema, nil
default:
return nil, fmt.Errorf("unknown schema reference: %s", uri.String())
}
},
ValidateDefaults: true,
})
}