diff --git a/AGENTS.md b/AGENTS.md index 3d31e33..f134655 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,15 +11,17 @@ omitted apart from one that was explicitly set to `null` or to a value. A contro ## Layout -| Project | Target | Purpose | -| --- | --- | --- | -| `PTrampert.SimplePatch` | net8.0 | Core package: `Optional`, `IPatchObject`, `PatchClassBuilder`, JSON converters, validation | -| `PTrampert.SimplePatch.Schema` | net8.0 | `PatchSchemaTransform`: the OpenAPI schema rewrite shared by both integration packages | -| `PTrampert.SimplePatch.Swashbuckle` | net8.0 | Swashbuckle schema filter | -| `PTrampert.SimplePatch.OpenApi` | net10.0 | `Microsoft.AspNetCore.OpenApi` schema transformer. It is net10.0 only because it needs `GetOrCreateSchemaAsync`. | -| `*.Test` | match their subject | NUnit test projects, one per shipped package (except `Schema`, which the integration tests cover) | -| `PTrampert.SimplePatch.Test.External` | net8.0 | A second assembly for the core tests, holding non-public types they use from another assembly. Not packed. | -| `PTrampert.SimplePatch.Sample` | net8.0 | Sample web API, not packed | +Every project targets `net10.0` only. Don't add another target framework without an issue for it. + +| Project | Purpose | +| --- | --- | +| `PTrampert.SimplePatch` | Core package: `Optional`, `IPatchObject`, `PatchClassBuilder`, JSON converters, validation | +| `PTrampert.SimplePatch.Schema` | `PatchSchemaTransform`: the OpenAPI schema rewrite shared by both integration packages | +| `PTrampert.SimplePatch.Swashbuckle` | Swashbuckle schema filter | +| `PTrampert.SimplePatch.OpenApi` | `Microsoft.AspNetCore.OpenApi` schema transformer | +| `*.Test` | NUnit test projects, one per shipped package (except `Schema`, which the integration tests cover) | +| `PTrampert.SimplePatch.Test.External` | A second assembly for the core tests, holding non-public types they use from another assembly. Not packed. | +| `PTrampert.SimplePatch.Sample` | Sample web API, not packed | Docs are built with docfx (`docfx.json`, `index.md`, `docs/`). The API reference is generated into `api/` from XML doc comments. `README.md` is packed into every NuGet package, so it is the diff --git a/PTrampert.SimplePatch.OpenApi/PTrampert.SimplePatch.OpenApi.csproj b/PTrampert.SimplePatch.OpenApi/PTrampert.SimplePatch.OpenApi.csproj index a109608..67be119 100644 --- a/PTrampert.SimplePatch.OpenApi/PTrampert.SimplePatch.OpenApi.csproj +++ b/PTrampert.SimplePatch.OpenApi/PTrampert.SimplePatch.OpenApi.csproj @@ -1,11 +1,6 @@ - net10.0 enable enable diff --git a/PTrampert.SimplePatch.Sample/PTrampert.SimplePatch.Sample.csproj b/PTrampert.SimplePatch.Sample/PTrampert.SimplePatch.Sample.csproj index 217c5e7..0d0a576 100644 --- a/PTrampert.SimplePatch.Sample/PTrampert.SimplePatch.Sample.csproj +++ b/PTrampert.SimplePatch.Sample/PTrampert.SimplePatch.Sample.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable diff --git a/PTrampert.SimplePatch.Schema/PTrampert.SimplePatch.Schema.csproj b/PTrampert.SimplePatch.Schema/PTrampert.SimplePatch.Schema.csproj index 8834168..82a85eb 100644 --- a/PTrampert.SimplePatch.Schema/PTrampert.SimplePatch.Schema.csproj +++ b/PTrampert.SimplePatch.Schema/PTrampert.SimplePatch.Schema.csproj @@ -1,11 +1,7 @@ - - net8.0 + net10.0 enable enable true diff --git a/PTrampert.SimplePatch.Swashbuckle.Test/PTrampert.SimplePatch.Swashbuckle.Test.csproj b/PTrampert.SimplePatch.Swashbuckle.Test/PTrampert.SimplePatch.Swashbuckle.Test.csproj index 06ecbd0..afc4abd 100644 --- a/PTrampert.SimplePatch.Swashbuckle.Test/PTrampert.SimplePatch.Swashbuckle.Test.csproj +++ b/PTrampert.SimplePatch.Swashbuckle.Test/PTrampert.SimplePatch.Swashbuckle.Test.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable diff --git a/PTrampert.SimplePatch.Swashbuckle/PTrampert.SimplePatch.Swashbuckle.csproj b/PTrampert.SimplePatch.Swashbuckle/PTrampert.SimplePatch.Swashbuckle.csproj index cc5b028..1fc0d49 100644 --- a/PTrampert.SimplePatch.Swashbuckle/PTrampert.SimplePatch.Swashbuckle.csproj +++ b/PTrampert.SimplePatch.Swashbuckle/PTrampert.SimplePatch.Swashbuckle.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable true diff --git a/PTrampert.SimplePatch.Test.External/PTrampert.SimplePatch.Test.External.csproj b/PTrampert.SimplePatch.Test.External/PTrampert.SimplePatch.Test.External.csproj index 48a855a..867b342 100644 --- a/PTrampert.SimplePatch.Test.External/PTrampert.SimplePatch.Test.External.csproj +++ b/PTrampert.SimplePatch.Test.External/PTrampert.SimplePatch.Test.External.csproj @@ -4,7 +4,7 @@ non-public property type from an assembly that, unlike the test project, grants no access to the generated patch classes. --> - net8.0 + net10.0 enable enable false diff --git a/PTrampert.SimplePatch.Test/PTrampert.SimplePatch.Test.csproj b/PTrampert.SimplePatch.Test/PTrampert.SimplePatch.Test.csproj index e2b5554..c449ad5 100644 --- a/PTrampert.SimplePatch.Test/PTrampert.SimplePatch.Test.csproj +++ b/PTrampert.SimplePatch.Test/PTrampert.SimplePatch.Test.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable diff --git a/PTrampert.SimplePatch/Optional.cs b/PTrampert.SimplePatch/Optional.cs index 63b6ead..009fa5f 100644 --- a/PTrampert.SimplePatch/Optional.cs +++ b/PTrampert.SimplePatch/Optional.cs @@ -64,7 +64,6 @@ public Optional(T value) /// True if the Optional has a value and the values are equal. False otherwise. public static bool operator ==(Optional left, T right) { - ArgumentNullException.ThrowIfNull(left); if (!left.HasValue) return false; if (left.Value != null) diff --git a/PTrampert.SimplePatch/PTrampert.SimplePatch.csproj b/PTrampert.SimplePatch/PTrampert.SimplePatch.csproj index 1ae1b8c..4ec4800 100644 --- a/PTrampert.SimplePatch/PTrampert.SimplePatch.csproj +++ b/PTrampert.SimplePatch/PTrampert.SimplePatch.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable enable true @@ -27,8 +27,7 @@ - - + diff --git a/README.md b/README.md index 7c805c8..4f9e8b7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ and your object contains additional properties besides `name`, PTrampert.SimpleP - Documents PATCH routes properly in OpenAPI, via optional Swashbuckle and `Microsoft.AspNetCore.OpenApi` integration packages. +## Requirements + +Every package targets `net10.0`, so your application needs .NET 10 or later. The last releases that +run on .NET 8 and .NET 9 are the 1.x line. + ## Getting Started A full sample project is available in the [PTrampert.SimplePatch.Samples](./PTrampert.SimplePatch.Sample) * Install the library via NuGet: @@ -167,7 +172,7 @@ dotnet add package PTrampert.SimplePatch.Swashbuckle builder.Services.AddSwaggerGen(options => options.AddSimplePatchSchemas()); ``` -### Microsoft.AspNetCore.OpenApi (.NET 10+) +### Microsoft.AspNetCore.OpenApi ```bash dotnet add package PTrampert.SimplePatch.OpenApi diff --git a/docs/getting-started.md b/docs/getting-started.md index 6fea990..22071da 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -78,7 +78,7 @@ dotnet add package PTrampert.SimplePatch })); ``` - On .NET 10 and later, `PTrampert.SimplePatch.OpenApi` does the same for the built-in generator: + `PTrampert.SimplePatch.OpenApi` does the same for the built-in generator: ```csharp builder.Services.AddOpenApi(options => options.AddSimplePatchSchemas()); diff --git a/docs/proposals/openapi-contract-generation.md b/docs/proposals/openapi-contract-generation.md index 4fc9f21..950c5b7 100644 --- a/docs/proposals/openapi-contract-generation.md +++ b/docs/proposals/openapi-contract-generation.md @@ -10,6 +10,10 @@ net9.0 as proposed in §3. Obtaining the source model's schema from a transforme have. Supporting .NET 9 would need a different mechanism, and .NET 9's OpenAPI.NET 1.6 object model would also fork the shared transform. Swashbuckle covers .NET 8 and 9 in the meantime. +Since 2.0, every package targets net10.0 only +([#76](https://github.com/PaulTrampert/PTrampert.SimplePatch/issues/76)), so the target frameworks +in §3 and §4 describe the 1.x packages. + ## 1. The problem A route that takes `[FromBody] IPatchObject` is documented from the