Object Validation Rule
Validate a Liferay Object entry via an external service.
# description
Registers a webhook that Liferay calls to validate an Object entry. Return `valid: false` and Liferay rejects the write with your error message.
Externalize business logic — actions, validation, workflow, notifications.
# when to use
- →Validation rules are more complex than the built-in expression language supports.
- →You need to validate against a live external source (address lookup, uniqueness across systems).
# how to use
- 01Ship a paired
oAuthApplicationUserAgent. - 02Set
resourcePath:to your validation handler; return{valid: bool, errorMessage: string}.
# required fields
| field | type | description |
|---|---|---|
resourcePathrequired | string | Validation handler path. |
oAuth2ApplicationExternalReferenceCoderequired | string | Ref code of the paired oAuthApplicationUserAgent. |
# optional fields
| field | type | description |
|---|---|---|
name | string | Display name. |
allowedObjectDefinitionNames | string[] | Restrict to specific Objects. |
dxp.lxc.liferay.com.virtualInstanceId | string | Scope to a virtual instance. |
# example
client-extension.yaml
address-validation:
type: objectValidationRule
name: Address Validation
resourcePath: /validate/address
oAuth2ApplicationExternalReferenceCode: my-oauth-ua# related types
Usually shipped alongside Object Validation Rule: