Skip to content

Commit a7860da

Browse files
committed
Packages: XML docs, symbols, icon, framework tags, release notes; the upgrade guide gets its own page
Every package now ships its XML documentation (CS1591 silenced), a Source Link symbols package built with ContinuousIntegrationBuild on master, the site favicon as its icon, tags naming the target frameworks, and release notes that say what 2.0 is and link to the What is new and Upgrading from 1.x pages on the documentation site. The README's Upgrading from 1.x section moves to docs/upgrading.md (the README keeps a summary and a link) so the site has an upgrading.html to land on, and CHANGELOG.md is published as changelog.html. One ambiguous cref in ServiceBinder fixed on the way.
1 parent fc520ec commit a7860da

12 files changed

Lines changed: 87 additions & 44 deletions

File tree

‎.github/workflows/build_publish_master.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ jobs:
3232
run: dotnet restore AustinHarris.JsonRpc.sln
3333
# Building the solution packs every package project (GeneratePackageOnBuild); `dotnet pack` on the
3434
# solution would trip NU5026 with GeneratePackageOnBuild, so the packages come from the build.
35+
# ContinuousIntegrationBuild makes the build deterministic and lets Source Link map the symbols package
36+
# (.snupkg, pushed alongside each .nupkg) back to this commit on GitHub.
3537
- name: Build
36-
run: dotnet build AustinHarris.JsonRpc.sln --configuration Release --no-restore
38+
run: dotnet build AustinHarris.JsonRpc.sln --configuration Release --no-restore -p:ContinuousIntegrationBuild=true
3739
- name: Test
3840
run: dotnet test AustinHarris.JsonRpcTestN --configuration Release --no-build
3941
# The key is requested after the tests so it is fresh for the push (it expires after one hour). `user` is the

‎AustinHarris.JsonRpc.AspNetCore/AustinHarris.JsonRpc.AspNetCore.csproj‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
<Description>ASP.NET Core / Kestrel hosting for JSON-RPC.Net: MapJsonRpc endpoint (PipeReader in, BodyWriter out, no strings), a raw Kestrel ConnectionHandler for JSON-RPC over TCP, and DI registration of services.</Description>
88
<VersionPrefix>2.0.0</VersionPrefix>
99
<VersionSuffix>preview.1</VersionSuffix>
10-
<PackageReleaseNotes>https://github.com/Astn/JSON-RPC.NET/blob/master/CHANGELOG.md</PackageReleaseNotes>
10+
<PackageReleaseNotes>2.0.0-preview.1, 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>
1111
<Copyright>Austin Harris</Copyright>
1212
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/aspnetcore.html</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
17-
<PackageTags>json-rpc;jsonrpc;json;rpc;server;aspnetcore;kestrel;pipelines</PackageTags>
17+
<PackageTags>json-rpc;jsonrpc;json;rpc;server;aspnetcore;asp.net-core;kestrel;pipelines;tcp;net8.0;net10.0</PackageTags>
1818
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
1919
<LangVersion>latest</LangVersion>
2020
<Nullable>disable</Nullable>
21+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
22+
<NoWarn>$(NoWarn);CS1591</NoWarn>
23+
<IncludeSymbols>true</IncludeSymbols>
24+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
25+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
26+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
27+
<PackageIcon>icon.png</PackageIcon>
2128
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2229
<RootNamespace>AustinHarris.JsonRpc.AspNetCore</RootNamespace>
2330
</PropertyGroup>
2431

2532
<ItemGroup>
2633
<None Include="README.md" Pack="true" PackagePath="\" />
34+
<None Include="..\icon.png" Pack="true" PackagePath="\" />
2735
</ItemGroup>
2836

2937
<ItemGroup>

‎AustinHarris.JsonRpc.Newtonsoft/AustinHarris.JsonRpc.Newtonsoft.csproj‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
<Description>Json.NET (Newtonsoft.Json) serializer for JSON-RPC.Net. Lenient parsing and full Json.NET conversion semantics; pass JsonSerializerSettings to control it.</Description>
88
<VersionPrefix>2.0.0</VersionPrefix>
99
<VersionSuffix>preview.1</VersionSuffix>
10-
<PackageReleaseNotes>https://github.com/Astn/JSON-RPC.NET/blob/master/CHANGELOG.md</PackageReleaseNotes>
10+
<PackageReleaseNotes>2.0.0-preview.1, 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>
1111
<Copyright>Austin Harris</Copyright>
1212
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/newtonsoft.html</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
17-
<PackageTags>json-rpc;jsonrpc;json;rpc;server;json.net;newtonsoft</PackageTags>
17+
<PackageTags>json-rpc;jsonrpc;json;rpc;server;json.net;newtonsoft;serializer;netstandard2.0;netstandard2.1;net8.0;net10.0</PackageTags>
1818
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net10.0</TargetFrameworks>
1919
<LangVersion>latest</LangVersion>
2020
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
21+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
22+
<NoWarn>$(NoWarn);CS1591</NoWarn>
23+
<IncludeSymbols>true</IncludeSymbols>
24+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
25+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
26+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
27+
<PackageIcon>icon.png</PackageIcon>
2128
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2229
<RootNamespace>AustinHarris.JsonRpc.Newtonsoft</RootNamespace>
2330
</PropertyGroup>
2431

2532
<ItemGroup>
2633
<None Include="README.md" Pack="true" PackagePath="\" />
34+
<None Include="..\icon.png" Pack="true" PackagePath="\" />
2735
</ItemGroup>
2836

2937
<ItemGroup>

‎AustinHarris.JsonRpc.SystemTextJson/AustinHarris.JsonRpc.SystemTextJson.csproj‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@
77
<Description>System.Text.Json serializer for JSON-RPC.Net. Utf8JsonReader/Utf8JsonWriter end to end; pass JsonSerializerOptions to control it.</Description>
88
<VersionPrefix>2.0.0</VersionPrefix>
99
<VersionSuffix>preview.1</VersionSuffix>
10-
<PackageReleaseNotes>https://github.com/Astn/JSON-RPC.NET/blob/master/CHANGELOG.md</PackageReleaseNotes>
10+
<PackageReleaseNotes>2.0.0-preview.1, 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>
1111
<Copyright>Austin Harris</Copyright>
1212
<PackageProjectUrl>https://astn.github.io/JSON-RPC.NET/systemtextjson.html</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/Astn/JSON-RPC.NET</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
17-
<PackageTags>json-rpc;jsonrpc;json;rpc;server;system.text.json</PackageTags>
17+
<PackageTags>json-rpc;jsonrpc;json;rpc;server;system.text.json;serializer;netstandard2.0;netstandard2.1;net8.0;net10.0</PackageTags>
1818
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net10.0</TargetFrameworks>
1919
<LangVersion>latest</LangVersion>
20+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
21+
<NoWarn>$(NoWarn);CS1591</NoWarn>
22+
<IncludeSymbols>true</IncludeSymbols>
23+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
25+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
26+
<PackageIcon>icon.png</PackageIcon>
2027
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2128
<RootNamespace>AustinHarris.JsonRpc.SystemTextJson</RootNamespace>
2229
</PropertyGroup>
2330

2431
<ItemGroup>
2532
<None Include="README.md" Pack="true" PackagePath="\" />
33+
<None Include="..\icon.png" Pack="true" PackagePath="\" />
2634
</ItemGroup>
2735

2836
<ItemGroup>

‎CHANGELOG.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
The four packages (`AustinHarris.JsonRpc`, `AustinHarris.JsonRpc.Newtonsoft`, `AustinHarris.JsonRpc.SystemTextJson`,
44
`AustinHarris.JsonRpc.AspNetCore`) share one version number and are released together. This file is the record
5-
of what changed in each version; the README's [Upgrading from 1.x](README.md#upgrading-from-1x) explains how to
6-
move a 1.x server, and the package pages on NuGet link here.
5+
of what changed in each version; [Upgrading from 1.x](docs/upgrading.md) explains how to move a 1.x server, and
6+
the package pages on NuGet link here.
77

88
Versions follow [Semantic Versioning](https://semver.org/) for the public API and the documented wire
99
behaviour: a breaking change to either means a new major version.

‎Json-Rpc/AustinHarris.JsonRpc.csproj‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@
1313
<RepositoryType>git</RepositoryType>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<PackageReadmeFile>README.md</PackageReadmeFile>
16-
<PackageTags>json-rpc;jsonrpc;json;rpc;server;netstandard;kestrel;pipelines;system.text.json;json.net;fast</PackageTags>
17-
<PackageReleaseNotes>https://github.com/Astn/JSON-RPC.NET/blob/master/CHANGELOG.md</PackageReleaseNotes>
16+
<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>
17+
<PackageReleaseNotes>2.0.0-preview.1: the request pipeline rebuilt around UTF-8 bytes, the JSON serializer pluggable, Task and ValueTask methods supported again, about ten times the throughput of 1.2.3 on the same machine. 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>
1818
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net10.0</TargetFrameworks>
1919
<LangVersion>latest</LangVersion>
20+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
21+
<NoWarn>$(NoWarn);CS1591</NoWarn>
22+
<IncludeSymbols>true</IncludeSymbols>
23+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
25+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
26+
<PackageIcon>icon.png</PackageIcon>
2027
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2128
</PropertyGroup>
2229

2330
<ItemGroup>
2431
<None Include="..\README.md" Pack="true" PackagePath="\" />
32+
<None Include="..\icon.png" Pack="true" PackagePath="\" />
2533
<InternalsVisibleTo Include="AustinHarris.JsonRpcTestN" />
2634
<InternalsVisibleTo Include="AustinHarris.JsonRpc.Micro" />
2735
</ItemGroup>

‎Json-Rpc/ServiceBinder.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void BindMethod(string name, Delegate implementation, string[] par
3333
/// <paramref name="parameterNames"/> when given (null entries keep the lambda's own name), else by the
3434
/// lambda's parameter names, else <c>arg1</c>, <c>arg2</c>... for a delegate whose names are not recoverable.
3535
/// <paramref name="defaults"/> (keyed by JSON name) make those parameters optional. The name must be free:
36-
/// re-registering a name is an error, unlike attribute binding; unbind it first with <see cref="UnbindMethod"/>.
36+
/// re-registering a name is an error, unlike attribute binding; unbind it first with <see cref="UnbindMethod(string, string)"/>.
3737
/// Task and ValueTask delegates require ProcessAsync; async void is rejected.
3838
/// <paramref name="contextFlow"/> controls ambient context across awaits.
3939
/// </summary>

‎README.md‎

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -618,37 +618,7 @@ Under the previous harness (one pass per batch, workstation GC) the two-million
618618

619619
## Upgrading from 1.x
620620

621-
Most 1.x services run unchanged. Read the first list before you build, and the second before you deploy next to existing clients.
622-
623-
### Changes that break the build
624-
625-
- **Serializer.** `JsonRpcProcessor.Process(…, JsonSerializerSettings)` is gone from the core. Use `Config.SetSerializer(new NewtonsoftJsonRpcSerializer(settings))` from the Newtonsoft package, or the helper overloads there that take the settings.
626-
- **Overloads.** The default-session string overloads that take a serializer take it first: `Process(serializer, json, context)` and `ProcessSync(serializer, json, context)`. `ProcessSync(sessionId, json, context, serializer)` makes `context` required, so `ProcessSync(json, null)` still means the default session. `Process` and `ProcessAsync` do not: `Process(json, null)` no longer compiles (it is ambiguous with the `JsonRpcStateAsync` overload), and `ProcessAsync(json, null)` binds to the session overload with `json` as the session id and a null document, which throws `ArgumentNullException`. Write `Process(json)`, `Process(json, context: null)` or `ProcessAsync(json, context: null)`.
627-
- **DTOs.** `JsonRequest`, `JsonResponse` and `JsonRpcException` are plain DTOs without Json.NET attributes. `JsonRequest.Params` is the active serializer's object model, so cast to `JObject`/`JArray` only when the Json.NET serializer is active.
628-
- **SMD.** `SMD.Services` is an `SMDServiceCollection` (an `IDictionary<string, SMDService>`) instead of a `Dictionary<string, SMDService>`, and its setter is gone. Every mutation through it updates the dispatch table at once, so a removed method is unreachable immediately. `SMD.Types` is now `Dictionary<int, Dictionary<string, object>>` and a process-wide registry (it was reset whenever a session was created).
629-
630-
### Changes clients will see on the wire
631-
632-
- **Version member.** The `jsonrpc` member is checked (`Config.VersionPolicy`, default `Lenient`): a missing member is still accepted, but `"jsonrpc":"1.0"` or a non-string value is now `-32600`. Set `Ignore` for the 1.x behaviour.
633-
- **Parse errors.** Requests nested deeper than 64 levels are `-32700` (configurable per serializer, see [Nesting depth](#nesting-depth)). Invalid UTF-8 and non-strict JSON (unless the serializer is lenient) are `-32700` as well.
634-
- **Batches.** The empty-batch error code is the spec's `-32600` (it was `3200`). Batches made only of notifications produce an empty response instead of `[]` with a dangling comma. A batch always answers with a JSON array when it produces at least one response; a one-request batch is no longer unwrapped to a bare response object.
635-
- **Notifications.** A notification (a request without an `id`) never gets a wire response, whatever its outcome: method not found, binding failure or an exception in the method produce nothing on the wire (the error handler still runs server-side). An invalid request object is not a notification and still gets `-32600` with `"id":null`.
636-
- **Exceptions.** An unhandled exception is `-32603` with `data: null` by default; 1.x sent the exception's type, message and stack trace. `Config.IncludeExceptionDetails = true` sends the full description; an error handler can author something in between. See [Exception disclosure](#exception-disclosure).
637-
- **Conversion errors.** A parameter value the serializer cannot convert (`"abc"` for an `int`, `"not-a-guid"` for a `Guid`) is `-32602` with `data = {"reason":"conversion","parameter":…,"index":…,"expectedType":…}`; it was `-32603` with the exception. An exception of the same type thrown inside the method is still `-32603`. A type the built-in serializer cannot handle at all stays `-32603` (now a `NotSupportedException`).
638-
- **Method not found.** `-32601`'s `data` is `{"method":"<name>"}` instead of the fixed sentence, and a method-not-found error for a notification now reaches the error handler (the wire still gets nothing).
639-
- **Named parameters.** They are checked against the method's parameter list: a supplied name that matches no parameter, or a name supplied twice, is `-32602` (it used to be ignored, so `optional(int a = 9)` called with `{"typo":4}` returned 9). Defaults fill only the names that are absent.
640-
- **Dates and non-finite numbers.** `DateTime` and `DateTimeOffset` are written the way Json.NET writes them by every serializer (fraction only when non-zero, `Z`/offset/nothing by `Kind`); `NaN` and the infinities are written as the quoted strings `"NaN"`, `"Infinity"`, `"-Infinity"` and read back from them.
641-
642-
### Behaviour inside your server
643-
644-
- **Async methods.** Task-returning methods are supported again through `ProcessAsync`, together with `ValueTask` and `ValueTask<T>`. Synchronous `Process`/`ProcessSync` reject them at call time without invoking them. `async void` remains rejected at registration. See [Asynchronous methods and cancellation](#asynchronous-methods-and-cancellation).
645-
- **Request id.** The invocation frame also carries the request id: `Handler.RpcRequestId()` / `JsonRpcContext.CurrentRequestId()`, `Handler.RpcRequestIdKind()` and `Handler.RpcRequestIdRaw()`, see [The request id](#the-request-id).
646-
- **Binding.** `ServiceBinder.BindMethod(sessionId, name, delegate)` registers any delegate; it refuses a name that is already registered, unlike `Handler.RegisterFuction`, which keeps replacing silently.
647-
- **Pre-process handlers.** A pre-process handler may replace `JsonRequest.Method`, `Params` or `Id`; the replaced request is what gets dispatched (as in 1.x). Assign a new `Params` value rather than editing the serializer's object model in place: a request the handler leaves untouched is dispatched straight from the request bytes.
648-
- **Context.** `JsonRpcContext.Current()` / `Handler.RpcContext()` and `JsonRpcContext.SetException` are per invocation: a method that synchronously processes another request through `JsonRpcProcessor` gets its own context and exception state back afterwards.
649-
- **Sessions.** A request for a session id that was never registered no longer creates the session; it answers `-32601`. Bind services or call `Handler.GetSessionHandler(sessionId)` before serving a session. `Config.SetBeforeProcessHandler(sessionId, …)` is now `Config.SetPreProcessHandler(sessionId, …)` (the old name still compiles, with an obsolete warning), and `Config.SetPostProcessHandler(sessionId, …)` exists.
650-
- **`JsonRpcService`.** The AspNetCore host binds a subclass to the configured session even when that is the default session; a subclass can pass `base(false)` to skip binding itself.
651-
- **`Handler.Handle(JsonRequest)`** still works; it round-trips the request through the serializer and the boxed path.
621+
Most 1.x services run unchanged. [Upgrading from 1.x](docs/upgrading.md) lists the changes that break the build, the changes clients will see on the wire and the behaviour changes inside your server. Read the first list before you build and the second before you deploy next to existing clients. [CHANGELOG.md](CHANGELOG.md) is the record of every change per version.
652622

653623
## Versioning and support
654624

‎docs/serializers.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@ constructor, throws `NotSupportedException` from `Read` (it was `JsonRpcBindExce
163163
on the wire.
164164

165165
For the complete list of protocol, error, batching, async, context and metadata changes, see
166-
[Upgrading from 1.x](../README.md#upgrading-from-1x) in the main README.
166+
[Upgrading from 1.x](upgrading.md).

0 commit comments

Comments
 (0)