Skip to content

breeze-client / ValidationMessageContext

Interface: ValidationMessageContext ​

Defined in: src/validation/validate.ts:29

Used by Validator to compose messages

Extends ​

Indexable ​

[key: string]: any

Properties ​

displayName? ​

optional displayName?: string

Defined in: src/validation/validate.ts:33

The name to show for the property in messages, as %displayName%. When it is not set, Breeze uses the property's displayName, or else propertyName, or "Value" when there is no property.


entity? ​

optional entity?: Entity

Defined in: src/validation/validate.ts:19

The entity whose property is being validated. Set when Breeze validates a property of an entity; an entity-level validator gets the entity as its value instead.

Inherited from ​

ValidationContext.entity


isAsync? ​

optional isAsync?: boolean

Defined in: src/validation/validate.ts:40

Marks the validator as async when its function returns a promise without being declared async, which Breeze cannot see. An async function needs no marking. See Validator.isAsync.


message? ​

optional message?: string | ((vc) => string)

Defined in: src/validation/validate.ts:37

A message to use instead of messageTemplate: a string, or a function that returns one from the context.


messageTemplate? ​

optional messageTemplate?: string

Defined in: src/validation/validate.ts:35

The error message template. Each %token% is replaced with the context property of that name, calling it with the context if it is a function. Defaults to the entry for the validator's name in Validator.messageTemplates.


name? ​

optional name?: string

Defined in: src/validation/validate.ts:31

The name of the validator. Set by the Validator constructor.


property? ​

optional property?: DataProperty | NavigationProperty

Defined in: src/validation/validate.ts:21

The DataProperty or NavigationProperty being validated. Set when Breeze validates a property.

Inherited from ​

ValidationContext.property


propertyName? ​

optional propertyName?: string

Defined in: src/validation/validate.ts:23

The name of the property being validated: a property path, such as address.city, for a property of a complex object.

Inherited from ​

ValidationContext.propertyName


signal? ​

optional signal?: AbortSignal

Defined in: src/validation/validate.ts:43

For an async validator, aborted when its result will no longer be used - another run of the same check started, or the entity was detached. Pass it on to fetch to cancel the request.


value? ​

optional value?: any

Defined in: src/validation/validate.ts:25

The value that failed validation, so that a message template can show it as %value%. Set by Validator.validate when validation fails.

Inherited from ​

ValidationContext.value

Released under the MIT License.