rest-validation

Implement input validation rules for OrangeHRM REST API v2 endpoints.

1.1k|746|Updated Jan 5, 2017
One-click install
npx skills add https://github.com/orangehrm/orangehrm --skill rest-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rest-validation
Source: https://github.com/orangehrm/orangehrm/tree/main/.agents/skills/rest-validation
Command: npx skills add https://github.com/orangehrm/orangehrm --skill rest-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the frustration of writing incorrect input validation rules for OrangeHRM REST API v2 endpoints, debugging opaque 422 "Invalid parameter" errors, and reinventing existing validation logic for common checks like email format or employee number access.

Core Features & Use Cases

  • Complete Validation Reference: Covers all core building blocks of OrangeHRM's REST API v2 validation system, including ParamRule, ParamRuleCollection, Rule, composite classes (ALL_OF/ANY_OF/ONE_OF/NONE_OF), and the ValidationDecorator for required/not-required field wrapping.
  • Built-in Rule Catalog: Includes a full listing of OrangeHRM custom validation rules (e.g. EMAIL, ENTITY_UNIQUE_PROPERTY, IN_ACCESSIBLE_EMP_NUMBERS) and Respect/Validation rule aliases, plus guidance for writing custom rule classes with DB access support.
  • Common Use Cases: Use this Skill when writing getValidationRuleFor*() methods for API endpoints, debugging 422 validation failures, creating new custom validation rules, or resolving issues where required fields incorrectly accept empty strings.

Quick Start

Reference this skill whenever you need to write, edit, or debug input validation rules for OrangeHRM REST API v2 endpoints to avoid 422 errors and ensure consistent validation logic.

Frequently Asked Questions about rest-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve a 422 invalid parameter error in the OrangeHRM REST API v2?

To resolve a 422 invalid parameter error in the OrangeHRM REST API v2, you need to implement correct input validation rules in your getValidationRuleFor*() methods using ParamRule and ParamRuleCollection to ensure parameters meet the expected formats.

How do I write custom validation rules for OrangeHRM API endpoints?

You can write custom validation rules for OrangeHRM API endpoints by creating custom rule classes that integrate with the existing validation logic, utilizing DB access support and combining them with built-in Respect/Validation aliases.

What validation components are available for OrangeHRM REST API v2 input validation?

Available validation components include ParamRule, ParamRuleCollection, Rule, composite classes like ALL_OF and ANY_OF, and the ValidationDecorator for wrapping required or optional fields during OrangeHRM REST API v2 input validation.

Why does my required OrangeHRM API field incorrectly accept empty strings?

Required OrangeHRM API fields may incorrectly accept empty strings if the ValidationDecorator is not properly configured to enforce non-empty constraints within your defined ParamRule or composite validation logic.

Can I integrate role-based access control with OrangeHRM API validation rules?

Yes, you can integrate role-based access control with OrangeHRM API validation rules by using specific built-in rules like IN_ACCESSIBLE_EMP_NUMBERS to perform entity and employee number checks during input validation.

How do I use composite validation logic for OrangeHRM API requests?

You can use composite validation logic for OrangeHRM API requests by applying composite classes such as ALL_OF, ANY_OF, ONE_OF, and NONE_OF to combine multiple Respect/Validation rules for complex parameter checking.