Skip to content

API vocabulary: MethodInfo spelled out, sessionId everywhere, legacy registration obsolete - #161

Merged
Astn merged 1 commit into
masterfrom
api-vocabulary
Sep 25, 2026
Merged

Astn merged 1 commit into
masterfrom
api-vocabulary

Conversation

@Astn

@Astn Astn commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Implements the API vocabulary decisions in AUS-986, reached in a debate on the naming of "method" and "session" and accepted by both sides. Before 2.0.0 final; no aliases for preview names.

The rule

"method" is always the JSON-RPC callable named on the wire; a MethodInfo is always spelled MethodInfo; the CLR side of a method is its implementation (a delegate, or a [JsonRpcMethod] member of a class or interface); a "service" is an object or type whose members become methods. A "session" is a named set of methods with its own configuration. ServiceBinder.BindMethod and UnbindMethod keep their names.

Code

  • RpcMethod.FromMethod (three overloads) is RpcMethod.FromMethodInfo; FromDelegate is unchanged.
  • RpcInterfaceMethod.Method is RpcInterfaceMethod.MethodInfo. This removes "inspect m.Method" on an RpcInterfaceMethod from the README, the double meaning the rule exists to remove.
  • Handler.RegisterFuction and UnRegisterFunction keep their names and behaviour and are [Obsolete]; the message on the first says that BindMethod throws on a duplicate name where RegisterFuction replaces it. Tests that exercise the legacy pair suppress CS0618 locally.
  • The session parameter is spelled sessionId on every overload; BindService, Handler.RegisterInstance and the JsonRpcService(string) constructor used sessionID. Only a named argument sessionID: breaks; the tree has none.
  • Handler gets a class summary; JsonRpcOptions.SessionSelector's summary says the selection is independent of ASP.NET Core session state.

Documentation

  • README "Defining methods" opens with a definition of method that says ServiceBinder never asks for a MethodInfo; the Delegates lead sentence is rewritten; "Sessions and context" opens with a definition of session.
  • The package README gets the one-sentence definition of a method after the Getting started service step.
  • CHANGELOG "Changed" and docs/upgrading.md "Changes that break the build" record the two renames and the spelling change.

Verification

  • dotnet build AustinHarris.JsonRpc.sln -c Release: 0 errors.
  • dotnet test AustinHarris.JsonRpcTestN -c Release: 1,191 passed on net8.0 and 1,191 on net10.0, 0 failed.
  • site/build.py, render.py --check and test_render.py pass; no benchmark figure changed.

…registration obsolete

"method" is the JSON-RPC callable named on the wire and a MethodInfo is
always spelled MethodInfo: RpcMethod.FromMethod is FromMethodInfo and
RpcInterfaceMethod.Method is MethodInfo. The session parameter is
spelled sessionId on every overload; BindService, Handler.RegisterInstance
and the JsonRpcService(string) constructor used sessionID. Handler gets a
class summary and SessionSelector's summary says the selection is
independent of ASP.NET Core session state.

Handler.RegisterFuction and UnRegisterFunction keep their names and
behaviour and are obsolete; the message says that BindMethod throws on a
duplicate name where RegisterFuction replaces it. Tests that exercise the
legacy pair suppress CS0618 locally.

The README defines "method" at the top of Defining methods and "session"
at the top of Sessions and context; the package README gets the method
sentence; CHANGELOG and the upgrade guide record the renames.
@Astn
Astn merged commit 9631b59 into master Sep 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant