Skip to content

Using default schema validator in database methods - #102

Open
saeedtabrizi wants to merge 4 commits into
moleculerjs:masterfrom
saeedtabrizi:patch-2
Open

saeedtabrizi wants to merge 4 commits into
moleculerjs:masterfrom
saeedtabrizi:patch-2

Conversation

@saeedtabrizi

Copy link
Copy Markdown

based on : #101

Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Shorthand fields crash service creation because existing callers omit the newly required parser and schema generation receives Moleculer’s wrapper rather than the underlying validator.

2 open issues
What changed in this PR

This PR aims to make database validation use the broker’s configured validator, allowing custom rules and plugins to apply to database methods as requested in issue #101.

Changes:

  • Replaces standalone validator instances with the broker validator.
  • Adds a validator parameter to schema-generation helpers and passes it through nested field processing.
File Description
src/​validation.js Uses the broker validator for field processing and database-method schema compilation.
src/​schema.js Accepts and propagates a validator for shorthand field parsing.

Review effort: Balanced

Comment thread src/schema.js Resolved
Comment thread src/validation.js Resolved
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