bouncer/internal/schema/load.go

18 lines
305 B
Go
Raw Normal View History

2023-04-24 20:52:12 +02:00
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
}