json_rpc_2: Add strictProtocolChecks parameter to Client

Open Beginner friendly
#2,422 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
dart
Domain
api

Research direction

Start in pkgs/json_rpc_2/lib/src/client.dart at the response protocol check cited in the issue, then compare it with the strictProtocolChecks handling in pkgs/json_rpc_2/lib/src/server.dart. Confirm that Client exposes equivalent control for responses and that the mjson use case can omit the jsonrpc field when configured to skip strict checks.

Written by the indexing model from the issue text.

Description

package:json_rpc_2

Server and Peer classes have the strictProtocolChecks parameter that allows to skip the check for "jsonrpc":"2.0" field in requests:

https://github.com/dart-lang/tools/blob/338a2c8380059afb250a1d0c26555e4da24c6ccc/pkgs/json_rpc_2/lib/src/server.dart#L251-L264

But for Client there's no way to skip that check in a response:

https://github.com/dart-lang/tools/blob/338a2c8380059afb250a1d0c26555e4da24c6ccc/pkgs/json_rpc_2/lib/src/client.dart#L228-L230

For context, I'm trying to get it working with mjson C library which doesn't add this field in its responses.

Dominant language
Dart
Stars
115
Forks
105
Avg merge
3d 3h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dart-lang/tools

All issues in dart-lang/tools

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.