Repository navigation
Bug-fix release for the 1.15.x line (Python 2.7, 3.6–3.14, PyPy): batches, JSON-RPC 1.0 notifications, and the Django/Flask backends.
pip install -U json-rpc==1.15.2Fixes
| Issue | PR | Change |
|---|---|---|
| #137 | #179 | In a batch, each invalid element gets its own Invalid Request error (id null) and the valid elements still run, in batch order. Before, one invalid element failed the whole batch. |
| #176 | #178 | A JSON-RPC 1.0 notification ("id": null) runs the method and returns no response; it used to raise (HTTP 500 in the backends). |
| #178 | Django: notifications get an empty body instead of the text None; JSON-RPC 1.0 calls with "params": [] no longer fail with HTTP 500. |
|
| #140 | #169 | The /map view HTML-escapes method names and docstrings. Flask enforces check_content_type. A request body that isn't valid UTF-8 gets a Parse error. Each request is parsed once. |
| #180 | Setting an invalid error on a response raises without changing the response. |
Breaking changes
These follow the documentation and the spec, but some clients will notice:
- Flask: with the default
check_content_type=True, requests withoutContent-Type: application/json(alsoapplication/json-rpc,application/jsonrequest) get HTTP 415. This also stops browsers from calling the API from other sites without a CORS preflight. To keep the old behavior, useJSONRPCAPI(check_content_type=False). - Batches with invalid elements return an array of responses instead of a single error.
[1]now returns[{"jsonrpc": "2.0", "error": {...}, "id": null}]. - Django, 2.0 requests with
"params": []: the Django request is passed positionally instead of asrequest=.... Methods defined asdef method(request)are unaffected.
What's next
This is the last release from master before json-rpc 2.0 work starts there. 1.15.x continues on the 1.x branch for bug fixes. The 2.0 design and plan are in docs/design/v2.md, and the roadmap is in #155.
Full changelog: 1.15.1...1.15.2