18 lines
305 B
Go
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
|
|
}
|