Skip to content

feat: add asyncValidtionExpression property to form field/container model - #1923

Open
vdua wants to merge 2 commits into
adobe:devfrom
vdua:asyncValidtionExpression
Open

feat: add asyncValidtionExpression property to form field/container model#1923
vdua wants to merge 2 commits into
adobe:devfrom
vdua:asyncValidtionExpression

Conversation

@vdua

@vdua vdua commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds asyncValidtionExpression (JCR property name intentionally matches, typo included) to the form field/container Sling Model, mirroring the existing validationExpression property.
  • Wired at the single shared point (AbstractBaseImpl), so it's automatically exposed on every Field/Container subtype (text input, number input, date picker, panel, etc.) without per-component overrides.
  • Allow-listed in the 0.15.2 JSON schema fixtures used by tests, in the same 11 field-type blocks that already permit validationExpression.
  • RuleUtils.js now also scans asyncValidtionExpression for custom function references (same treatment as validationExpression), so custom functions referenced only in async validation expressions still get registered on window.

Out of scope (explicitly, per discussion): a paired constraint-message property (validateExpMessage-style) and any authoring/dialog UI — this PR only adds the raw expression property to the model and schema.

Changes

  • Java model: BaseConstraint.java (default method), ReservedProperties.java (JCR property constant), AbstractBaseImpl.java (@ValueMapValue field + @JsonInclude(NON_EMPTY) getter)
  • Schema: adaptive-form-data-constraints.schema.json, adaptive-form.schema.json (0.15.2)
  • Java tests: BaseConstraintTest, TextInputImplTest (blank-value suppression + populated round-trip export/schema validation)
  • JS: RuleUtils.js + RuleUtils.test.js
  • Docs: note in docs/architecture/overview.md on deriving golden-file ids from a failing-test diff instead of hand-computing them

Test plan

  • TextInputImplTest — 62/62 passing (mvn surefire:test -Dtest=TextInputImplTest)
  • BaseConstraintTest — 4/4 passing
  • RuleUtils.test.js — 12/12 passing (npx jest RuleUtils.test.js)

🤖 Generated with Claude Code

vdua and others added 2 commits July 17, 2026 13:07
…odel

Mirrors validationExpression (interface default, JCR-bound field/getter in
AbstractBaseImpl, allow-listed in the 0.15.2 JSON schema) without the
paired constraint-message wiring. RuleUtils.js now also scans the
property for custom function references, same as validationExpression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The property is rolling out to a limited set of customer instances first,
so AbstractBaseImpl#getAsyncValidtionExpression() now returns null unless
the toggle is enabled, mirroring the FT_SKIP_ITEMS_MAP /
FT_SKIP_DEFAULT_SET_PROPERTY_EVENT pattern. Jira: FORMS-26583.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
public static final String PN_DOR_TEMPLATE_REF = "dorTemplateRef";
public static final String PN_DOR_TYPE = "dorType";
public static final String PN_VALIDATION_EXPRESSION = "validationExpression";
public static final String PN_ASYNC_VALIDATION_EXPRESSION = "asyncValidtionExpression";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

@rismehta

Copy link
Copy Markdown
Collaborator

@vdua You need to update the spec as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants