summaryrefslogtreecommitdiffstats
path: root/modules/migration/schemas_static.go
blob: 832dfd86cf7f54d05535ac6c4b2b8d0d7636eef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

//go:build bindata

package migration

import (
	"path"

	"github.com/santhosh-tekuri/jsonschema/v6"
)

type SchemaLoader struct{}

func (*SchemaLoader) Load(filename string) (any, error) {
	f, err := Assets.Open(path.Base(filename))
	if err != nil {
		return nil, err
	}
	defer f.Close()
	return jsonschema.UnmarshalJSON(f)
}