CheckObject checks arbitrary data against the schema
(ctx context.Context, obj any)
| 311 | |
| 312 | // CheckObject checks arbitrary data against the schema |
| 313 | func (check SchemaCheck) CheckObject(ctx context.Context, obj any) (bool, []jsonschema.KeyError, error) { |
| 314 | bytes, err := json.Marshal(obj) |
| 315 | if err != nil { |
| 316 | return false, nil, err |
| 317 | } |
| 318 | errs, err := check.Validator.ValidateBytes(ctx, bytes) |
| 319 | return len(errs) == 0, errs, err |
| 320 | } |
| 321 | |
| 322 | // CheckAdditionalObjects looks for an object that passes the specified additional schema |
| 323 | func (check SchemaCheck) CheckAdditionalObjects(ctx context.Context, groupkind string, objects []any) (bool, error) { |
no outgoing calls