Class: JSONRPC::Validator
- Inherits:
-
Object
- Object
- JSONRPC::Validator
- Defined in:
- lib/jsonrpc/validator.rb
Overview
Validates JSON-RPC 2.0 requests, notifications and batches
The Validator handles parameter validation for JSON-RPC requests by checking method signatures against registered procedure definitions using Dry::Validation contracts.
Instance Method Summary collapse
-
#validate(batch_or_request) ⇒ JSONRPC::Error, ...
Validates a single request, notification or a batch.
Instance Method Details
#validate(batch_or_request) ⇒ JSONRPC::Error, ...
Validates a single request, notification or a batch
32 33 34 35 36 37 38 39 |
# File 'lib/jsonrpc/validator.rb', line 32 def validate(batch_or_request) case batch_or_request when BatchRequest validate_batch_params(batch_or_request) when Request, Notification validate_request_params(batch_or_request) end end |