All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.6.0 - 2025-09-17
- MultiJson support for improved JSON performance and flexibility
- Configuration option to select JSON adapter (
JSONRPC.configuration.json_adapter) - Enhanced error handling with adapter and input preview details
- Better performance through optimized JSON parsing
- Configuration option to select JSON adapter (
- Enhanced examples
- Batch JSON-RPC request handling in Rails single-file routing example
- Smart home control API example using Rails routing DSL
- Updated documentation with batch request usage examples
- Replaced JSON gem with MultiJson throughout the codebase
- All JSON parsing now uses MultiJson for better adapter support
- Updated documentation to mention optimized JSON handling
- Refactored Request and Response classes to use dry-struct
- Simplified class definitions with automatic type checking
- Reduced code complexity while maintaining functionality
- Enhanced Rails integration
- Improved example applications with better error handling
- Updated Gemfile.lock files across all examples
0.5.0 - 2025-07-22
- Rails routing DSL for elegant JSON-RPC method mapping with support for namespaces and batch handling:
# In routes.rb jsonrpc '/' do # Handle batch requests batch to: 'batch#handle' method 'on', to: 'main#on' method 'off', to: 'main#off' namespace 'lights' do method 'on', to: 'lights#on' # becomes lights.on method 'off', to: 'lights#off' # becomes lights.off end namespace 'climate' do method 'on', to: 'climate#on' # becomes climate.on method 'off', to: 'climate#off' # becomes climate.off namespace 'fan' do method 'on', to: 'fan#on' # becomes climate.fan.on method 'off', to: 'fan#off' # becomes climate.fan.off end end end
JSONRPC::BatchConstraintfor routing JSON-RPC batch requests to dedicated controllers:# Handle batch requests with custom constraint post '/api', to: 'api#handle_batch', constraints: JSONRPC::BatchConstraint.new # Or use the DSL (recommended) jsonrpc '/api' do batch to: 'api#handle_batch' end
- Procedure registration now supports optional validation blocks (defaults to empty contract):
# Before: Always required validation block (even if empty) procedure('ping') do params do # No params needed end end # After: Optional validation block procedure('ping') # Uses empty contract by default # Still works with validation when needed procedure('add') do params do required(:a).value(:integer) required(:b).value(:integer) end end
- Simplified example configurations by removing unnecessary empty validation blocks
- Enhanced Rails integration with automatic DSL registration via Railtie
0.4.0 - 2025-07-18
JSONRPC::BatchRequest#process_eachmethod for simplified batch processing
0.3.0 - 2025-07-17
- Rails routing support with method constraints for JSON-RPC procedures
- Rails single-file routing example application
- Method constraint helper for Rails routing integration
- Updated Ruby to v3.4.5 across all environments
- Updated development dependencies (bundler, overcommit, rubocop, rubocop-yard)
- Updated examples dependencies to use latest versions
- Improved documentation for Rails single-file applications
- Standardized Ruby version usage across the project
0.2.0 - 2025-07-10
- Rails support via Railtie for automatic middleware registration
- Configuration options for logging, internal error handling, and error rendering
- Complete YARD documentation for all public APIs
- Rails application examples (single-file and full application)
- Sinatra application examples (classic and modular styles)
- Pure Rack application examples
- AI development guidelines for Claude Code, Copilot, and Cursor
- Enhanced helper methods with improved framework-agnostic support
- Improved error handling with configurable logging capabilities
- Updated development dependencies for better compatibility
- Method parameter handling in Rack examples
0.1.0 - 2025-06-14
- Initial release of the JSON-RPC 2.0 middleware for Rack applications
- Complete implementation of the JSON-RPC 2.0 specification
- Core components:
JSONRPC::Middlewarefor handling JSON-RPC requests in Rack applicationsJSONRPC::Parserfor parsing and validating JSON-RPC requestsJSONRPC::Validatorfor validating procedure parametersJSONRPC::Configurationfor registering and managing procedures
- Support for all JSON-RPC request types:
- Single requests with responses
- Notifications (requests without responses)
- Batch requests (multiple requests/notifications in a single call)
- Parameter validation via Dry::Validation:
- Support for both positional and named arguments
- Customizable validation rules and error messages
- Comprehensive error handling:
- Parse errors
- Invalid request errors
- Method not found errors
- Invalid params errors
- Internal errors
- Helper methods for request and response processing
- Examples for basic and advanced usage scenarios