bouncer/internal/schema/load.go
William Petit e66938f1d3
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: initial commit
2023-05-21 22:27:25 +02:00

18 lines
305 B
Go

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