Home PredicateFormat Class
PredicateFormat Class
Cancel

PredicateFormat Class

Namespace: Json.Schema

Inheritance: PredicateFormat 🡒 Format 🡒 object

A Json.Schema.Format that uses a predicate for evaluation.

Properties

NameTypeSummary
KeystringThe format key.

Constructors

PredicateFormat(string key, Func<JsonNode, bool> predicate)

Creates a new Json.Schema.PredicateFormat.

Declaration

1
public PredicateFormat(string key, Func<JsonNode, bool> predicate)
ParameterTypeDescription
keystringThe format key.
predicateFunc<JsonNode, bool>The predicate.

PredicateFormat(string key, PredicateWithErrorMessage predicate)

Creates a new Json.Schema.PredicateFormat.

Declaration

1
public PredicateFormat(string key, PredicateWithErrorMessage predicate)
ParameterTypeDescription
keystringThe format key.
predicatePredicateWithErrorMessageThe predicate.

Methods

Validate(JsonNode element, out string errorMessage)

Validates an instance against a format and provides an error message.

Declaration

1
public override bool Validate(JsonNode element, out string errorMessage)
ParameterTypeDescription
elementJsonNodeThe element to validate.
errorMessageout string 

Returns

true. Override to return another value.

Contents