mcpField
B
bitrix-validation

bitrix-validation

github.com/bxmaximumDevelopment47269 installsUpdated 2w ago
Repository

About bitrix-validation

A Bitrix development skill for validating DTOs and controller inputs with the framework's validation facilities. It documents supported rules, custom validators, version constraints, and how to propagate validation errors.

Key features

  1. 01Define validation rules on DTOs
  2. 02Validate controller action parameters
  3. 03Support nested objects and collections
  4. 04Create custom rules and validators
  5. 05Propagate errors through Result

Use cases

  1. 01Validate nested service input
  2. 02Apply rules to controller parameters
  3. 03Return validation errors through service results

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bxmaximum/bitrix-framework-skills --skill bitrix-validation

After installing, type/bitrix-validationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
controller.md
custom.md
rules-dto.md

Details

From the project README

Validation

Baseline: main 23.0+ · Verified: main 26.800.0

The whole namespace is Since main 24.300. Before that, check input by hand in the service and return Result errors (bitrix-result-and-errors).

TaskRead
Rule attributes, DTOs, nested objects, collections, groups, ValidationServicerules/rules-dto.md
Controller input: rules on action params, ValidationParameter DTOsrules/controller.md
Custom rule attribute and validator, error codesrules/custom.md

Invariants

  • Service: ServiceLocator::getInstance()->get('main.validation.service'), or type-hint ValidationService in a service constructor (stateless).
  • There is no .settings.php validation section and no #[ValidationParameter] attribute.
  • Names: RegExp (not Regex), errorMessage (not message). Errors have no getField(): the property path is in getCode() (email, items.0.name).
  • Rules on action params, groups, #[Json], #[OnlyOneOfPropertyRequired] are Since main 26.250*. On 25.x a rule on an action param is silently ignored: validate a DTO instead.
  • ValidationResult extends Result: pass its errors up via the service Result, don't throw.

Comments

Markdown supported