Update Go dependencies (#36781)
Update all non-locked Go dependencies and pin incompatible ones. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -12,10 +12,17 @@ import (
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
||||
"github.com/santhosh-tekuri/jsonschema/v5"
|
||||
"github.com/santhosh-tekuri/jsonschema/v6"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// schemaLoader implements jsonschema.URLLoader
|
||||
type schemaLoader struct{}
|
||||
|
||||
func (l *schemaLoader) Load(url string) (any, error) {
|
||||
return openSchema(url)
|
||||
}
|
||||
|
||||
// Load project data from file, with optional validation
|
||||
func Load(filename string, data any, validation bool) error {
|
||||
isJSON := strings.HasSuffix(filename, ".json")
|
||||
@@ -43,7 +50,7 @@ func unmarshal(bs []byte, data any, isJSON bool) error {
|
||||
|
||||
func getSchema(filename string) (*jsonschema.Schema, error) {
|
||||
c := jsonschema.NewCompiler()
|
||||
c.LoadURL = openSchema
|
||||
c.UseLoader(&schemaLoader{})
|
||||
return c.Compile(filename)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user