github pavlov99/json-rpc 1.15.1

latest release: 1.15.2
one hour ago

Bug-fix release for the 1.15.x line (Python 2.7, 3.6–3.14, PyPy), focused on spec compliance and error reporting.

pip install -U json-rpc==1.15.1

Fixes

Issue PR Change
#139, #46 #166 A response that cannot be serialized no longer raises from .json (HTTP 500 in the Django/Flask backends); a valid JSON-RPC error for the same id is sent instead. Batches now use the backends' datetime/Decimal serializer.
#47 #165 A TypeError raised inside a method is reported as -32000 Server error instead of -32602 Invalid params, for bound methods, callable objects, functools.partial and *args/**kwargs functions.
#136 #163 Methods with a context_arg no longer mutate request.params or the caller's context; each call gets its own copy.
#113 #164 JSON-RPC 1.0 responses always include both result and error (the unused one null), as the 1.0 spec requires.
#138 #161 JSON-RPC 2.0 ids: fractional numbers are accepted; true/false, NaN and Infinity are rejected with Invalid Request.
#135 #162 Setting an error on a response clears a stale result.

Behavior changes to check

These follow the spec, but clients relying on the old behavior will notice:

  • JSON-RPC 1.0: a successful response now contains "error": null. Detect errors by a non-null error, not by the presence of the key.
  • Boolean ids ("id": true) now get -32600 Invalid Request instead of being executed.
  • Error codes: some responses change from -32602 to -32000 (bugs inside methods), and from HTTP 500 to a JSON-RPC error (unserializable responses).
  • context_arg: writing into the context inside a method no longer changes the caller's dict.

Also

  • CI moved to GitHub Actions, testing every supported interpreter in its official Docker image and the built wheel (#134, #159). The Django backend tests had been silently skipped on Django ≥ 2.0 and run again.
  • Packaging metadata now declares python_requires, so pip will keep older interpreters on 1.15.x once 2.0 requires Python ≥ 3.10 (#133).

Thanks to @angary-iwancanse, @omartitouhi and @KainanP for their contributions.

What's next: json-rpc 2.0 (Python ≥ 3.10, native asyncio, pluggable serializers). Roadmap and ways to help in #155. 1.15.x keeps receiving bug fixes.

Full changelog: 1.15.0...1.15.1

Don't miss a new json-rpc release

NewReleases is sending notifications on new releases.