Skip to content

Server-side node validators declared in JavaScript #693

Description

@romain-pm

Part of EPIC #554. Implemented — under review in #687.

registerNodeValidator({ nodeType, name?, skipOnImport?, advanced? }, validate) rejects saves with field-level (propertyName) or node-level violations surfaced in Content Editor and GraphQL errors. Bridge design (ADR-0005): a single Bean Validation bean registered under sentinel nt:base — exactly-once execution per changed node, no clobbering of Java validators — with four repeatable class-level constraints mirroring Jahia's default/advanced/skip-on-import phases. Messages follow JahiaMessageInterpolator semantics: {bundle.key} → resource-bundle i18n, anything else verbatim. Fail-closed on throwing validators. Async callbacks supported (#688).

Live-verified on Jahia 8.2 (phases, verbatim special-character messages, GqlConstraintViolationException shape). Docs: reference 3-node-validators. Tests: full Bean Validation chain against real Hibernate Validator 6.2.0.Final + registrar state machine + nodeValidatorTest.cy.ts.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions