json_rpc_2 4.0.0
json_rpc_2: ^4.0.0 copied to clipboard
Utilities to write a client or server using the JSON-RPC 2.0 spec.
4.0.0 #
- Add custom ID generator option to clients, which allows for
Stringids. - Breaking: When
Stringids are present in a response, we no longer automatically try to parse them as integers. This behavior was never a part of the spec, and is not compatible with allowing custom ID generators.
3.0.3 #
- Require Dart 3.4
- Move to
dart-lang/toolsmonorepo.
3.0.2 #
- Switch to using
package:lints. - Address a few analysis hint violations.
- Populate the pubspec
repositoryfield.
3.0.1 #
- Fix a bug where a
nullresult to a request caused an exception.
3.0.0 #
- Migrate to null safety.
- Accept responses even if the server converts the ID to a String.
2.2.2 #
- Fix
Peer.close()throwingBad state: Future already completed.
2.2.1 #
- Fix
Peerrequests not terminating when the underlying channel is closed.
2.2.0 #
- Added
strictProtocolChecksnamed parameter toServerandPeerconstructors. Setting this parameter to false will result in the server not rejecting requests missing thejsonrpcparameter.
2.1.1 #
- Fixed issue where throwing
RpcException.methodNotFoundin an asynchronous fallback handler would not result in the next fallback being executed. - Updated minimum SDK to Dart
2.2.0.
2.1.0 #
Serverand related classes can now take anonUnhandledErrorcallback to notify callers of unhandled exceptions.
2.0.10 #
- Allow
stream_channelversion 2.x
2.0.8 #
- Updated SDK version to 2.0.0-dev.17.0
2.0.7 #
- When a
Clientis closed before a request completes, the error sent to that request'sFuturenow includes the request method to aid in debugging.
2.0.6 #
- Internal changes only.
2.0.5 #
- Internal changes only.
2.0.4 #
-
Client.sendRequest()now throws aStateErrorif the client is closed while the request is in-flight. This avoids danglingFutures that will never be completed. -
Both
Client.sendRequest()andClient.sendNotification()now throwStateErrors if they're called after the client is closed.
2.0.3 #
- Fix new strong-mode warnings.
2.0.2 #
- Fix all strong-mode warnings.
2.0.1 #
- Fix a race condition in which a
StateErrorcould be top-leveled ifPeer.close()was called before the underlying channel closed.
2.0.0 #
-
Breaking change: all constructors now take a
StreamChannelrather than aStream/StreamSinkpair. -
Client.sendRequest()andClient.sendNotification()no longer throwStateErrors after the connection has been closed but beforeClient.close()has been called. -
The various
close()methods may now be called before their correspondinglisten()methods. -
The various
close()methods now wait on the result of closing the underlyingStreamSink. Be aware that in some circumstancesStreamControllers'Sink.close()futures may never complete.
1.2.0 #
-
Add
Client.isClosedandServer.isClosed, which make it possible to synchronously determine whether the connection is open. In particular, this makes it possible to reliably tell whether it's safe to callClient.sendRequest. -
Fix a race condition in
Serverwhere aStateErrorcould be thrown if the connection was closed in the middle of handling a request. -
Improve stack traces for error responses.
1.1.1 #
- Update the README to match the current API.
1.1.0 #
- Add a
donegetter toClient,Server, andPeer.
1.0.0 #
-
Add a
Clientclass for communicating with external JSON-RPC 2.0 servers. -
Add a
Peerclass that's both aClientand aServer.
0.1.0 #
-
Remove
Server.handleRequest()andServer.parseRequest(). Instead,new Server()takes aStreamand aStreamSinkand uses those behind-the-scenes for its communication. -
Add
Server.listen(), which causes the server to begin listening to the underlying request stream. -
Add
Server.close(), which closes the underlying request stream and response sink.
0.0.2+3 #
- Widen the version constraint for
stack_trace.
0.0.2+2 #
- Fix error response to include data from
RpcExceptionwhen not a map.