Class ValidationRuleError
A single inline validation rule failure, located at FieldPath within the message that was validated.
Inherited Members
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public class ValidationRuleError
Constructors
ValidationRuleError(ValidationRule, string, string, Exception)
Creates a new validation rule error.
Declaration
public ValidationRuleError(ValidationRule rule, string fieldPath, string message = null, Exception cause = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ValidationRule | rule | |
| string | fieldPath | |
| string | message | |
| Exception | cause |
Properties
Cause
The underlying exception, when the rule failed to evaluate.
Declaration
public Exception Cause { get; }
Property Value
| Type | Description |
|---|---|
| Exception |
FieldPath
The dotted path of the value that failed, empty for the root.
Declaration
public string FieldPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Message
An optional dynamic error message returned by the rule itself — set when the
rule expression returned a non-empty string explaining the failure (e.g.
x > 0 ? '' : 'x must be positive'). Null when the failure was a
plain false or an evaluation error.
Declaration
public string Message { get; }
Property Value
| Type | Description |
|---|---|
| string |
Rule
The rule that failed.
Declaration
public ValidationRule Rule { get; }
Property Value
| Type | Description |
|---|---|
| ValidationRule |
Methods
ToString()
Renders the failure as "path: name: detail", preferring the dynamic message returned by the rule and falling back to its doc, SQL, then expression.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |