Skip to content

2.0.0

Choose a tag to compare

@jwcarman jwcarman released this 09 Apr 18:39
· 47 commits to main since this release

RipCurl 2.0.0

Breaking Changes — Sealed Request Hierarchy

JsonRpcRequest is now a sealed interface. Requests with an id are JsonRpcCall, notifications are JsonRpcNotification.

JsonRpcMessage (sealed)
├── JsonRpcRequest (sealed)
│   ├── JsonRpcCall (method + params + id)
│   └── JsonRpcNotification (method + params, no id)
└── JsonRpcResponse (sealed)
    ├── JsonRpcResult
    └── JsonRpcError

The dispatcher accepts JsonRpcRequest and pattern-matches internally:

return switch (request) {
    case JsonRpcCall call -> dispatchCall(call);
    case JsonRpcNotification notification -> dispatchNotification(notification);
};

Migration

1.x 2.0
new JsonRpcRequest("2.0", "method", params, id) new JsonRpcCall("2.0", "method", params, id)
new JsonRpcRequest("2.0", "method", params, null) new JsonRpcNotification("2.0", "method", params)
request.response(result) call.result(result)

Other Changes

  • Constructor invariants enforced via Objects.requireNonNull on method and id
  • params type validation — rejects non-Object/Array params per JSON-RPC 2.0 spec
  • SLF4J logging for method registration, discovery, and notification failures
  • Expanded JSON-RPC 2.0 compliance test suite

Full Changelog

See CHANGELOG.md