Add schema selection values and ownership
This commit is contained in:
@@ -183,6 +183,15 @@ func validateArtifact(ctx context.Context, artifact *domain.Artifact, contract d
|
||||
}
|
||||
}
|
||||
|
||||
// DecodeInlineSchema converts a caller-supplied value to an owned JSON document.
|
||||
func DecodeInlineSchema(ctx context.Context, value any) (any, error) {
|
||||
encoded, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return decodeJSONValue(ctx, encoded)
|
||||
}
|
||||
|
||||
func decodeJSONValue(ctx context.Context, body []byte) (any, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user