Add schema selection values and ownership

This commit is contained in:
2026-11-20 15:20:29 +00:00
parent e775a3c116
commit fbe3d427a2
17 changed files with 186 additions and 9 deletions

View File

@@ -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