Other

JSON-RPC 2.0: Protocol Choice and the Request Pipeline

DEV Community: #dotnet Jeff Tsai
Other

A .NET framework that exposes its whole surface through a single POST endpoint explains why it picked JSON-RPC 2.0 over REST and traces the fixed pipeline every call passes through. Two payload layers, one parameter per method and four deviations from the specification come with a cost.

Key points

  • Two of the nine pipeline stops live in the HTTP layer and the rest in dispatch.
  • A single API payload fills `params`, so every exposed method declares exactly one Args parameter.
  • Deviations from the spec: no batches, string-only `id`, no notifications, and `method` echoed in the response.
  • `JsonRpcExecutor` splits the method string on '.' with a limit of two segments.
  • Access control runs before `params.value` is restored, so rejected calls pay no decryption cost.
  • The no-credential list is case sensitive while the type registry is not, so `system.Ping` returns HTTP 401.

Real-world use

  • Building a client for a form-centric ERP back end whose whole surface is one endpoint and one method string.
  • An API where authorization must be decided before any payload decryption happens, not after model binding.
  • A system that wants to swap JSON for MessagePack without touching any method signature.
  • Evolving the contract by adding properties to Args types while old callers keep sending the defaults.

This summary was generated by the agent from the original post on DEV Community: #dotnet. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message