swagger updates to only support 10.X version removed support for 9. A…#41
Merged
swagger updates to only support 10.X version removed support for 9. A…#41
Conversation
…lso updated Microsoft.OpenApi to 2.X version from 1.X versions. This change requires to have support for Swagger 10.x
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the DomainPrimitives OpenAPI/Swagger integration to align with Swagger/Swashbuckle 10.x and Microsoft.OpenApi 2.x by removing legacy conditional paths and regenerating expected outputs.
Changes:
- Removed
NET10_0_OR_GREATERconditional branches and standardized OpenAPI schema types/usings. - Updated generator OpenAPI helper emission and refreshed Verify snapshot baselines accordingly.
- Centralized package versions for OpenAPI/Swagger dependencies and bumped package version.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/AltaSoft.DomainPrimitives.SwaggerExtensions/SwaggerGenOptionsExt.cs | Removes conditional OpenAPI usings and standardizes on Microsoft.OpenApi. |
| src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiHelperProcessor.cs | Removes conditional OpenAPI usings and standardizes on Microsoft.OpenApi. |
| src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs | Removes old OpenAPI generation branch and emits a single OpenAPI helper shape. |
| Directory.Packages.props | Centralizes OpenAPI/SwaggerGen package versions without TFM-specific blocks. |
| Directory.Build.props | Bumps library version to 7.2.0. |
| Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj | Updates Microsoft.OpenApi package reference to a single modern version. |
| Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj | Updates OpenAPI/Swashbuckle references for the demo app. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ULongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UInt16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeSpanValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithTransformerGeneratesTransformerCall#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConvertersForInternalClass#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringOfStringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.SByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.LongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntOfIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.Int16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.GuidValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.FloatValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DoubleValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutTypeConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutJsonConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DecimalValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeOffsetValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeSpan_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTime_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTimeOffset_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CharValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
| tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.BoolValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs | Snapshot updated for new OpenAPI helper output/usings. |
Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs:35
- AddOpenApiSchemas always adds
System.Text.Json.Nodesto the generated usings list, butJsonValueis only emitted when an<example>XML doc node exists. This can generate CS8019 (unnecessary using) warnings for consumers. Consider only adding this using when at least one type has an example (or always emitting aJsonValuereference).
var usings = types.ConvertAll(x => x.Namespace);
usings.Add("Microsoft.OpenApi");
usings.Add("System");
usings.Add("System.Collections.Frozen");
usings.Add("System.Collections.Generic");
usings.Add("System.Text.Json.Nodes");
usings.Add("AltaSoft.DomainPrimitives");
src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs
Outdated
Show resolved
Hide resolved
…rHelper.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
…lso updated Microsoft.OpenApi to 2.X version from 1.X versions.
This change requires to have support for Swagger 10.x