Description
Description:
The current Validator service in the Relay package is not optimal, leading to confusion and overlapping logic. Its structure and functionality are unclear, making it difficult to maintain and extend.
Additionally, the service works alongside the @rpcParamValidationRules annotation to validate RPC methods against predefined validation parameters. However, the integration lacks clarity, and the validation process could be more structured and efficient.
Solution:
- Move the @rpcParamValidationRules decorator from the validator module to the decorators folder for better organization
- Standardize the @rpcParamValidationRules decorator to use consistent array syntax for multiple types instead of the mixed array/pipe-separated format
- Replace inconsistent validation patterns with the standardized validateSchema approach
- Clean up overlapping validation logic in types and utils for better maintainability
- Improve type safety and developer experience with the validation schemas