Class JsonUtils
JSON Schema utilities
Inherited Members
Namespace: Confluent.SchemaRegistry.Serdes
Assembly: Confluent.SchemaRegistry.Serdes.Json.dll
Syntax
public static class JsonUtils
Methods
Transform(RuleContext, JsonSchema, JsonSchema, string, object, IFieldTransform)
Declaration
public static Task<object> Transform(RuleContext ctx, JsonSchema rootSchema, JsonSchema schema, string path, object message, IFieldTransform fieldTransform)
Parameters
| Type | Name | Description |
|---|---|---|
| RuleContext | ctx | |
| JsonSchema | rootSchema | |
| JsonSchema | schema | |
| string | path | |
| object | message | |
| IFieldTransform | fieldTransform |
Returns
| Type | Description |
|---|---|
| Task<object> |
Validate(IValidationRuleExecutor, JsonSchema, object, bool)
Walks the message against the schema, evaluating every inline "confluent:rules" constraint encountered and collecting all failures. Read-only — the message is not modified.
Two kinds of rules are evaluated:
- Object-level ("confluent:rules" on an object schema) —
thisis the object. - Property-level ("confluent:rules" on a property schema) —
thisis the property value. Honors the skip-on-null contract: a property that is absent or null does not have its rules invoked.
Failures are returned with their location, rooted at "$" to match the JVM client (e.g. $.addr.zip, $.tags[3]). The walk continues after each failure unless failFast is set.
Declaration
public static Task<IList<ValidationRuleError>> Validate(IValidationRuleExecutor executor, JsonSchema rootSchema, object message, bool failFast)
Parameters
| Type | Name | Description |
|---|---|---|
| IValidationRuleExecutor | executor | |
| JsonSchema | rootSchema | |
| object | message | |
| bool | failFast |
Returns
| Type | Description |
|---|---|
| Task<IList<ValidationRuleError>> |