Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/api_surface/ApiSurface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<JsonRpcVersion Condition="'$(JsonRpcVersion)' == ''">2.0.0-preview.3</JsonRpcVersion>
<JsonRpcVersion Condition="'$(JsonRpcVersion)' == ''">2.0.0</JsonRpcVersion>
<NoWarn>$(NoWarn);CS0618;JSONRPC0001;JSONRPC0002;JSONRPC0003</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/check_package_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Handler.UnRegisterFunction and Config.SetBeforeProcessHandler as the published assembly carries it, formats each
UrlFormat with its DiagnosticId, requests the page and asserts the anchor id is in the HTML.

Usage: python3 .github/scripts/check_package_links.py 2.0.0-preview.3 [--keep] (exit 1 on any failure)
Usage: python3 .github/scripts/check_package_links.py 2.0.0 [--keep] (exit 1 on any failure)

The check runs against nuget.org, so it is a release step (after the publish workflow has run and the flat
container lists the version, which lags the push by a few minutes), not a pull-request gate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<Product>Json-Rpc.Net ASP.NET Core host</Product>
<Description>ASP.NET Core hosting for AustinHarris.JsonRpc. Adds HTTP endpoints and raw Kestrel connections over TCP, Unix sockets and named pipes, with dependency injection.</Description>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>preview.3</VersionSuffix>
<PackageReleaseNotes>2.0.0-preview.3, released with the core package: strong-named assemblies and the error-handler change. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<PackageReleaseNotes>2.0.0, released with the core package. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<Copyright>Austin Harris</Copyright>
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/aspnetcore.html</PackageProjectUrl>
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion AustinHarris.JsonRpc.AspNetCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ without converting the document to a string.
## Install

```sh
dotnet add package AustinHarris.JsonRpc.AspNetCore --prerelease
dotnet add package AustinHarris.JsonRpc.AspNetCore
```

Targets `net8.0` and `net10.0`; depends on the `AustinHarris.JsonRpc` core package and the ASP.NET Core shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<Product>Json-Rpc.Net Json.NET serializer</Product>
<Description>Json.NET serializer for AustinHarris.JsonRpc. Uses JsonSerializerSettings for converters, contract resolvers and lenient JSON input.</Description>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>preview.3</VersionSuffix>
<PackageReleaseNotes>2.0.0-preview.3, released with the core package: strong-named assemblies and the error-handler change. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<PackageReleaseNotes>2.0.0, released with the core package. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<Copyright>Austin Harris</Copyright>
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/newtonsoft.html</PackageProjectUrl>
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion AustinHarris.JsonRpc.Newtonsoft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Configure parameter and result conversion with `JsonSerializerSettings`.
## Install

```sh
dotnet add package AustinHarris.JsonRpc.Newtonsoft --prerelease
dotnet add package AustinHarris.JsonRpc.Newtonsoft
```

Targets `netstandard2.0`, `netstandard2.1`, `net8.0` and `net10.0`; depends on Newtonsoft.Json 13.0.4 and the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<Product>Json-Rpc.Net System.Text.Json serializer</Product>
<Description>System.Text.Json serializer for AustinHarris.JsonRpc. Reads UTF-8 parameters and writes results directly to the response buffer, configured with JsonSerializerOptions.</Description>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>preview.3</VersionSuffix>
<PackageReleaseNotes>2.0.0-preview.3, released with the core package: strong-named assemblies and the error-handler change. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<PackageReleaseNotes>2.0.0, released with the core package. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<Copyright>Austin Harris</Copyright>
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/systemtextjson.html</PackageProjectUrl>
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion AustinHarris.JsonRpc.SystemTextJson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ response buffer.
## Install

```sh
dotnet add package AustinHarris.JsonRpc.SystemTextJson --prerelease
dotnet add package AustinHarris.JsonRpc.SystemTextJson
```

Targets `netstandard2.0`, `netstandard2.1`, `net8.0` and `net10.0`; depends on System.Text.Json 10.0.3 and the
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the package pages on NuGet link here.
Versions follow [Semantic Versioning](https://semver.org/) for the public API and the documented wire
behaviour: a breaking change to either means a new major version.

## 2.0.0 (in preview: `2.0.0-preview.3`)
## 2.0.0 (2026-09-28)

### Added

Expand All @@ -34,8 +34,8 @@ behaviour: a breaking change to either means a new major version.

### Changed

- The four assemblies are strong-named (preview.3). One key, `AustinHarris.JsonRpc.snk` at the repository root, signs the packages and the friend assemblies, and stays the same from here on: changing a strong-name key changes the assembly identity. Public key token `e6819c02cf4aec44`. A signed caller can now reference the packages without CS8002, and .NET Framework loads them from a signed assembly.
- An error handler receives the exception the method threw (preview.3). Previously the library replaced an exception that had an `InnerException` with that inner exception, and promoted an inner `JsonRpcException` to the response, so a handler saw the cause instead of the error and an authored outer error lost its message. Now only the wrappers the invocation machinery adds are stripped, a `TargetInvocationException` and a single-inner `AggregateException`, on the synchronous and asynchronous paths alike; everything else, inner exception included, reaches the handler as thrown.
- The four assemblies are strong-named. One key, `AustinHarris.JsonRpc.snk` at the repository root, signs the packages and the friend assemblies, and stays the same from here on: changing a strong-name key changes the assembly identity. Public key token `e6819c02cf4aec44`. A signed caller can now reference the packages without CS8002, and .NET Framework loads them from a signed assembly.
- An error handler receives the exception the method threw. Previously the library replaced an exception that had an `InnerException` with that inner exception, and promoted an inner `JsonRpcException` to the response, so a handler saw the cause instead of the error and an authored outer error lost its message. Now only the wrappers the invocation machinery adds are stripped, a `TargetInvocationException` and a single-inner `AggregateException`, on the synchronous and asynchronous paths alike; everything else, inner exception included, reaches the handler as thrown.
- `RpcMethod.FromMethod` is `RpcMethod.FromMethodInfo`; `RpcInterfaceMethod.Method` is `RpcInterfaceMethod.MethodInfo`. A `MethodInfo` is always spelled out; "method" means the JSON-RPC method.
- The session parameter is spelled `sessionId` on every overload (`BindService`, `Handler.RegisterInstance` and the `JsonRpcService` constructor used `sessionID`).
- `Handler.RegisterFuction` and `UnRegisterFunction` are obsolete; use `ServiceBinder.BindMethod` and `UnbindMethod` (which throw on a duplicate name instead of replacing it).
Expand Down
3 changes: 1 addition & 2 deletions Json-Rpc/AustinHarris.JsonRpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
<Product>Json-Rpc.Net Core</Product>
<Description>High-throughput JSON-RPC 2.0 server library for .NET Standard 2.0 through .NET 10: UTF-8 bytes in and out, no JSON library dependency, with Json.NET, System.Text.Json and ASP.NET Core hosting as companion packages.</Description>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>preview.3</VersionSuffix>
<Copyright>Austin Harris</Copyright>
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/</PackageProjectUrl>
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>json-rpc;jsonrpc;json;rpc;server;netstandard;netstandard2.0;netstandard2.1;net8.0;net10.0;kestrel;pipelines;system.text.json;json.net;fast</PackageTags>
<PackageReleaseNotes>2.0.0-preview.3: the four assemblies are strong-named with one key that stays fixed from here on, and an error handler now receives the exception the method threw, with its cause attached, instead of that exception's inner exception. preview.2 brought document and batch limits on by default (JsonRpcLimits), reserved method names refused at registration, InProcessClient removed, diagnostic ids on the obsolete members, and the documentation site. Since preview.1 the request pipeline is built around UTF-8 bytes, the JSON serializer is pluggable and Task and ValueTask methods are supported again, at six times the throughput of 1.2.3 through the 1.x string API and twenty-four times through the byte entry points, measured on a 32-core Hugging Face Jobs host (see the README). What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<PackageReleaseNotes>2.0.0: the request pipeline is built around UTF-8 bytes (ReadOnlySequence, ReadOnlyMemory or ReadOnlySpan in, IBufferWriter out), the JSON serializer is pluggable with the built-in serializer as the default and Json.NET and System.Text.Json as packages, and Task and ValueTask methods are supported again through ProcessAsync with cooperative cancellation. Document and batch limits are on by default (JsonRpcLimits), reserved method names are refused at registration, unknown named parameters are rejected, an error handler receives the exception the method threw, and the four assemblies are strong-named with one key that stays fixed from here on. Six times the throughput of 1.2.3 through the 1.x string API and twenty-four times through the byte entry points, measured on a 32-core Hugging Face Jobs host (see the README). InProcessClient is removed; three legacy members are obsolete at warning level with diagnostic ids JSONRPC0001 to JSONRPC0003. What is new: https://astn.github.io/JSON-RPC.NET/changelog.html. Upgrading from 1.x: https://astn.github.io/JSON-RPC.NET/upgrading.html</PackageReleaseNotes>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
8 changes: 3 additions & 5 deletions Json-Rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ This is a server library, with no client proxies or server-to-client calls.

## Install

2.0 is a prerelease. Include `--prerelease` when installing:

```sh
dotnet add package AustinHarris.JsonRpc --prerelease
dotnet add package AustinHarris.JsonRpc
```

Coming from 1.x? Read [What is new in 2.0](https://astn.github.io/JSON-RPC.NET/changelog.html) and [Upgrading from 1.x](https://astn.github.io/JSON-RPC.NET/upgrading.html) first.
Expand All @@ -32,7 +30,7 @@ The `#:sdk` and `#:package` directives select the web SDK and package.

```csharp
#:sdk Microsoft.NET.Sdk.Web
#:package AustinHarris.JsonRpc.AspNetCore@2.0.0-preview.3
#:package AustinHarris.JsonRpc.AspNetCore@2.0.0

using AustinHarris.JsonRpc;
using AustinHarris.JsonRpc.AspNetCore;
Expand All @@ -59,7 +57,7 @@ curl -s -X POST http://127.0.0.1:5077/rpc -H "Content-Type: application/json" -d
{"jsonrpc":"2.0","result":3.0,"id":1}
```

On .NET 8, use the same code in `Program.cs` in an ordinary ASP.NET Core project, install with `dotnet add package AustinHarris.JsonRpc.AspNetCore --prerelease`, and drop the two `#:` lines.
On .NET 8, use the same code in `Program.cs` in an ordinary ASP.NET Core project, install with `dotnet add package AustinHarris.JsonRpc.AspNetCore`, and drop the two `#:` lines.

For a service class, create `CalculatorService.cs`.
Derive from `JsonRpcService` and mark exposed methods with `[JsonRpcMethod]`.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JSON-RPC.Net

![Build Master](https://github.com/Astn/JSON-RPC.NET/workflows/Build%20Master/badge.svg) ![NuGet](https://img.shields.io/nuget/v/AustinHarris.JsonRpc) ![NuGet preview](https://img.shields.io/nuget/vpre/AustinHarris.JsonRpc?label=preview)
![Build Master](https://github.com/Astn/JSON-RPC.NET/workflows/Build%20Master/badge.svg) ![NuGet](https://img.shields.io/nuget/v/AustinHarris.JsonRpc)

A JSON-RPC server has a short job description: read a request, call a method, write a response. The work around that call can be considerably larger. JSON-RPC.Net 2.0 keeps the core at the document boundary: UTF-8 bytes go in, UTF-8 bytes come out, and your application chooses how they travel. The same service can sit behind Kestrel, a pipe, a socket, or a browser page.

Expand Down Expand Up @@ -33,7 +33,7 @@ Here is a server you can put in one file. Save it as `server.cs`; the `#:` direc

```csharp
#:sdk Microsoft.NET.Sdk.Web
#:package AustinHarris.JsonRpc.AspNetCore@2.0.0-preview.3
#:package AustinHarris.JsonRpc.AspNetCore@2.0.0

using AustinHarris.JsonRpc;
using AustinHarris.JsonRpc.AspNetCore;
Expand All @@ -59,7 +59,7 @@ curl -s -X POST http://127.0.0.1:5077/rpc -H "Content-Type: application/json" -d
{"jsonrpc":"2.0","result":3.0,"id":1}
```

That is the whole round trip. A request without an `id` is a notification and gets no response; a batch is an array of requests and gets an array of responses, omitting notifications. On .NET 8, put the same C# code in an ASP.NET Core `Program.cs`, remove the two `#:` lines, and install `AustinHarris.JsonRpc.AspNetCore` with `--prerelease`.
That is the whole round trip. A request without an `id` is a notification and gets no response; a batch is an array of requests and gets an array of responses, omitting notifications. On .NET 8, put the same C# code in an ASP.NET Core `Program.cs`, remove the two `#:` lines, and install `AustinHarris.JsonRpc.AspNetCore`.

### Calling the core directly

Expand Down Expand Up @@ -92,7 +92,7 @@ The core has no JSON-library dependency. Its built-in serializer is the default;
| `AustinHarris.JsonRpc.Newtonsoft` | Json.NET settings, converters, attributes or lenient input. |
| `AustinHarris.JsonRpc.SystemTextJson` | System.Text.Json options and converters. |

2.0 is currently `2.0.0-preview.3`. For an existing project, install the core with `dotnet add package AustinHarris.JsonRpc --prerelease`, then add the serializer or ASP.NET Core package you need. Without `--prerelease`, NuGet selects the last 1.x release.
For an existing project, install the core with `dotnet add package AustinHarris.JsonRpc`, then add the serializer or ASP.NET Core package you need.

## Defining methods

Expand Down Expand Up @@ -391,7 +391,7 @@ Most 1.x services run unchanged. [Upgrading from 1.x](docs/upgrading.md) lists t

## Versioning and support

The four 2.x packages are released together at one version; use matching versions. Public API and documented wire behavior follow [Semantic Versioning](https://semver.org/). There is no fixed release cadence. Previews such as `2.0.0-preview.N` are tested but may change API before the stable release; 1.x receives no further releases.
The four 2.x packages are released together at one version; use matching versions. Public API and documented wire behavior follow [Semantic Versioning](https://semver.org/). There is no fixed release cadence. A preview (`2.0.0-preview.N`) is tested but may change API before the stable release it precedes; 1.x receives no further releases.

Obsolete members warn with a `JSONRPC0xxx` diagnostic and a link to the [replacement](docs/obsoletions.md). They remain warnings through 2.x and are removed in the next major version. [CHANGELOG.md](CHANGELOG.md) records changes. Report vulnerabilities privately through [SECURITY.md](SECURITY.md); use [GitHub issues](https://github.com/Astn/JSON-RPC.NET/issues) for questions and bugs.

Expand Down
Loading
Loading