Add a new ParsedRequest type and return that instead of Request.
The latter is intended for consumption by Handler methods, and is hard to use
effectively in other contexts. The new type exposes validation errors that
occur during parsing and allows the caller to detect specific problems with
each individual request in a batch separately.
This change also allows us to consolidate the checking of version errors, and
to remove most of the special case checks inside the client and server.
Update the jhttp.Bridge to use the new ParsedRequest type.
Update test cases. In cases where we really needed a jrpc2.Request, use the
newly introduced internal/testutil package, which uses the server plumbing to
render a request.
Add a new ParsedRequest type and return that instead of Request. The latter is intended for consumption by Handler methods, and is hard to use effectively in other contexts. The new type exposes validation errors that occur during parsing and allows the caller to detect specific problems with each individual request in a batch separately.
This change also allows us to consolidate the checking of version errors, and to remove most of the special case checks inside the client and server.
Update the jhttp.Bridge to use the new ParsedRequest type.
Update test cases. In cases where we really needed a jrpc2.Request, use the newly introduced internal/testutil package, which uses the server plumbing to render a request.
Fixes #80.