From e6161124fa2510755bf5f5d3819844f9af09d660 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 21:16:59 +0000 Subject: [PATCH 1/4] Bump Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers Bumps [Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers](https://github.com/dotnet/upgrade-assistant) from 0.4.336902 to 0.4.346202. - [Release notes](https://github.com/dotnet/upgrade-assistant/releases) - [Changelog](https://github.com/dotnet/upgrade-assistant/blob/main/CHANGELOG.md) - [Commits](https://github.com/dotnet/upgrade-assistant/commits) --- updated-dependencies: - dependency-name: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Microsoft.OpenApi.Workbench.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj b/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj index 326ef4b69..a47b5af48 100644 --- a/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj +++ b/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj @@ -7,7 +7,7 @@ true - + all From 61e878eecbdffe0e1261b6166e09ede495a25d8b Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Mon, 26 Sep 2022 13:12:54 +0300 Subject: [PATCH 2/4] Call base constructor for cloning responses object --- src/Microsoft.OpenApi/Models/OpenApiResponses.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi/Models/OpenApiResponses.cs b/src/Microsoft.OpenApi/Models/OpenApiResponses.cs index 24f4eba0d..aa7a8c984 100644 --- a/src/Microsoft.OpenApi/Models/OpenApiResponses.cs +++ b/src/Microsoft.OpenApi/Models/OpenApiResponses.cs @@ -16,7 +16,7 @@ public OpenApiResponses() { } /// /// Initializes a copy of object /// - public OpenApiResponses(OpenApiResponses openApiResponses) { } - + /// The + public OpenApiResponses(OpenApiResponses openApiResponses) : base(dictionary: openApiResponses) {} } } From d87393d2df2f863981d43effd4d86b989c33b9cd Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Mon, 26 Sep 2022 13:13:12 +0300 Subject: [PATCH 3/4] Add test case to validate --- .../Models/OpenApiOperationTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/Microsoft.OpenApi.Tests/Models/OpenApiOperationTests.cs b/test/Microsoft.OpenApi.Tests/Models/OpenApiOperationTests.cs index 167383b36..368aeb227 100644 --- a/test/Microsoft.OpenApi.Tests/Models/OpenApiOperationTests.cs +++ b/test/Microsoft.OpenApi.Tests/Models/OpenApiOperationTests.cs @@ -787,5 +787,16 @@ public void SerializeOperationWithNullCollectionAsV2JsonWorks() expected = expected.MakeLineBreaksEnvironmentNeutral(); actual.Should().Be(expected); } + + [Fact] + public void EnsureOpenApiOperationCopyConstructorCopiesResponsesObject() + { + // Arrange and act + var operation = new OpenApiOperation(_operationWithBody); + + // Assert + Assert.NotNull(operation.Responses); + Assert.Equal(2, operation.Responses.Count); + } } } From 194ef814417b7d619ee36107616be8f092ed5f3d Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Mon, 26 Sep 2022 13:16:27 +0300 Subject: [PATCH 4/4] Bump lib version for release --- src/Microsoft.OpenApi/Microsoft.OpenApi.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi/Microsoft.OpenApi.csproj b/src/Microsoft.OpenApi/Microsoft.OpenApi.csproj index 3cac5e0b0..233d0717e 100644 --- a/src/Microsoft.OpenApi/Microsoft.OpenApi.csproj +++ b/src/Microsoft.OpenApi/Microsoft.OpenApi.csproj @@ -11,7 +11,7 @@ Microsoft Microsoft.OpenApi Microsoft.OpenApi - 1.4.2 + 1.4.3 .NET models with JSON and YAML writers for OpenAPI specification © Microsoft Corporation. All rights reserved. OpenAPI .NET