Repository navigation
Target .NET 10 and .NET 11, drop .NET 8/9, use OpenApiSchema.Examples - #51
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The Microsoft.OpenApi major-version split needs runtime verification of OpenAPI 3.0 Examples fallback and transformer behavior against both resolved package sets, beyond the new compilation and schema-snapshot tests.
No open issues 🎉
What changed in this PR
Updates AltaSoft.DomainPrimitives to target .NET 10 and .NET 11, drops .NET 8/9 support, and migrates generated OpenAPI schema examples from Example to Examples.
Changes:
- Updates framework targets, framework-specific dependencies, CI SDKs, and the library version to 9.0.0.
- Uses
OpenApiSchema.Examplesin generated schemas and schema mappings. - Adds snapshot coverage for string and numeric XML examples and documents the new requirements.
| File | Description |
|---|---|
tests/AltaSoft.DomainPrimitives.XmlDataTypes.Tests/AltaSoft.DomainPrimitives.XmlDataTypes.Tests.csproj |
Runs XML datatype tests on both target frameworks. |
tests/AltaSoft.DomainPrimitives.UnitTests/AltaSoft.DomainPrimitives.UnitTests.csproj |
Runs behavioral tests on both target frameworks. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#PositiveAmountTypeConverter.g.verified.cs |
Adds the numeric type-converter snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#PositiveAmountJsonConverter.g.verified.cs |
Adds the numeric JSON-converter snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#PositiveAmount.g.verified.cs |
Adds the generated numeric primitive snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#OpenApiHelper.g.verified.cs |
Captures schema examples and string constraints. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#CountryCodeTypeConverter.g.verified.cs |
Adds the string type-converter snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#CountryCodeJsonConverter.g.verified.cs |
Adds the string JSON-converter snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithXmlExampleStringLengthAndPattern#CountryCode.g.verified.cs |
Adds the generated string primitive snapshot. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/DomainPrimitiveGeneratorTest.cs |
Adds XML example coverage for string and numeric primitives. |
tests/AltaSoft.DomainPrimitives.Generator.Tests/AltaSoft.DomainPrimitives.Generator.Tests.csproj |
Runs generator tests on both target frameworks. |
src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiOptionsExt.cs |
Copies schema Examples instead of Example. |
src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs |
Emits XML examples into the Examples collection. |
README.md |
Documents supported frameworks and OpenAPI changes. |
Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj |
Updates framework targets and OpenAPI package versions. |
Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj |
Multi-targets the demo and aligns integration dependencies. |
Directory.Packages.props |
Selects framework-specific dependencies and updates test tooling. |
Directory.Build.props |
Sets .NET 10/11 defaults and version 9.0.0. |
.github/workflows/publish_nuget.yml |
Installs .NET 10/11 SDKs for publishing. |
.github/workflows/dotnet.yml |
Installs .NET 10/11 SDKs for CI. |
.github/workflows/build_nuget_dont_publish.yml |
Installs .NET 10/11 SDKs for package builds. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the library to
net10.0+net11.0and dropsnet8.0/net9.0. Packages that ship separate builds per .NET version now get framework-specific versions; everything else uses the latest version without a framework condition.Target frameworks
Directory.Build.props:DefaultTargetFrameworkschanged tonet10.0;net11.0.AltaSoft.DomainPrimitives.OpenApiExtensions: now multi-targetsnet10.0;net11.0(wasnet10.0only).net10.0;net11.0, so the suite runs on both runtimes.DomainPrimitivesDemo,AltaSoft.DomainPrimitives.Demo) targetnet10.0;net11.0.Package versions (
Directory.Packages.props)10.0.*11.0.*2.*3.*10.3.*11.0.*Microsoft.OpenApi3.x even onnet10.0, whileMicrosoft.AspNetCore.OpenApi10.x requires 2.x. Sonet10.0stays on Swashbuckle 10.3 / OpenApi 2.x.Microsoft.NET.Test.Sdk18.11.1,xunit.runner.visualstudio4.0.1,coverlet.collector10.1.0.Microsoft.CodeAnalysis.*is already on the latest version (5.9.0).OpenAPI:
Example→ExamplesOpenApiSchema.Exampleis[Obsolete("Use Examples instead.")]inMicrosoft.OpenApi2.13+ and 3.x.<example>XML doc value asExamples = [JsonValue.Create(...)]inOpenApiHelper.g.cs.OpenApiOptionsExt.ApplyDomainPrimitiveSchemascopiesExamplesinstead ofExample.AltaSoft.DomainPrimitives.SwaggerExtensionsnow referencesMicrosoft.OpenApidirectly. Onnet10.0, Swashbuckle 10.3 alone only requires OpenApi 2.7.5, whose OpenAPI 3.0 writer ignoresExamples. The direct reference raises the floor to 2.13+, which falls back toExamples[0]for OpenAPI 3.0 documents.Tests
StringValue_WithXmlExampleStringLengthAndPatterncovers<example>for string and numeric primitives (no test previously covered this path).dotnet build: 0 warnings, 0 errors.dotnet test: all passing on bothnet10.0andnet11.0(UnitTests 88, XmlDataTypes.Tests 103, Generator.Tests 48).Docs
Exampleschange.