William Petit
8d91f646c2
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
20 lines
316 B
Go
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
|
|
}
|