bouncer/internal/schema/load.go
William Petit 8d91f646c2
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: refactor layers registration
2023-06-23 17:54:34 -06:00

20 lines
316 B
Go

package schema
import (
"encoding/json"
"github.com/pkg/errors"
"github.com/qri-io/jsonschema"
)
type Schema = jsonschema.Schema
func Parse(data []byte) (*Schema, error) {
var schema Schema
if err := json.Unmarshal(data, &schema); err != nil {
return nil, errors.WithStack(err)
}
return &schema, nil
}