Repository navigation
fix(models): preserve specification extensions in OpenApiPaths and OpenApiResponses copy constructors - #3162
Merged
Vincent Biret (baywet) merged 8 commits intoNov 6, 2026
Conversation
Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
…ions Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
… extensions Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
…tensions Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
…onses extensions Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
…ths and Responses copy constructors Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
…ponses copy constructors Signed-off-by: Hardik K <hardikkaurani1@gmail.com>
Contributor
Author
|
While working with the model copy constructors, I noticed that Since the This PR updates both copy constructors to pass a shallow copy of Whenever you have a moment, I'd appreciate your review. Thank you! |
Vincent Biret (baywet)
approved these changes
Nov 6, 2026
Vincent Biret (baywet)
added a commit
that referenced
this pull request
Nov 6, 2026
…enApiResponses copy constructors (#3162) (#3163) * fix(models): preserve extensions in OpenApiPaths copy constructor * test(models): add unit tests for OpenApiPaths copy constructor extensions * test(models): verify OpenApiDocument copy constructor preserves Paths extensions * fix(models): preserve extensions in OpenApiResponses copy constructor * test(models): add unit tests for OpenApiResponses copy constructor extensions * test(models): verify OpenApiOperation copy constructor preserves Responses extensions * test(models): add edge case tests for null and empty extensions in Paths and Responses copy constructors * docs(models): update XML documentation on OpenApiPaths and OpenApiResponses copy constructors --------- Signed-off-by: Hardik K <hardikkaurani1@gmail.com> Co-authored-by: Hardik K <hardikkaurani1@gmail.com>
This was referenced Nov 17, 2026
This was referenced Nov 30, 2026
Open
Sebastian Paul Boghiu (ThorSPB)
pushed a commit
to CampusPulse-ro/api
that referenced
this pull request
Nov 30, 2026
Updated [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 10.1.0 to 10.1.1. <details> <summary>Release notes</summary> _Sourced from [coverlet.collector's releases](https://github.com/coverlet-coverage/coverlet/releases)._ ## 10.1.1 ### Improvements - Add `IsReachable` to branch points, computed from the method's control-flow graph, and exclude unreachable branches from branch-coverage totals and from branch details in Cobertura, LCOV and OpenCover reports [#2056](coverlet-coverage/coverlet#2056) by @pcshrosbree - coverlet.MTP: Narrow Dynamic Exclude Filters for Loaded Assemblies [#2069](coverlet-coverage/coverlet#2069) ### Fixed - Fix Regression Prevent invalid IL from branch trampolines [#2067](coverlet-coverage/coverlet#2067) - Fix Regression coverlet.MTP does not instrument local functions [#2046](coverlet-coverage/coverlet#2046) ## Maintenance - Update NuGet package versions [#2050](coverlet-coverage/coverlet#2050) [Diff between 10.1.0 and 10.1.1](coverlet-coverage/coverlet@v10.1.0...v10.1.1) Commits viewable in [compare view](coverlet-coverage/coverlet@v10.1.0...v10.1.1). </details> Updated [Microsoft.AspNetCore.Authentication.JwtBearer](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.Authentication.JwtBearer's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.AspNetCore.Mvc.Testing](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.Mvc.Testing's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.AspNetCore.OpenApi](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.OpenApi's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Pinned [Microsoft.EntityFrameworkCore](https://github.com/dotnet/dotnet) at 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.EntityFrameworkCore.Design](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore.Design's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.EntityFrameworkCore.Relational](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore.Relational's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.ApiDescription.Server](https://github.com/dotnet/dotnet) from 10.0.14 to 10.0.15. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.ApiDescription.Server's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 18.11.0 to 18.12.0. <details> <summary>Release notes</summary> _Sourced from [Microsoft.NET.Test.Sdk's releases](https://github.com/microsoft/vstest/releases)._ ## 18.12.0 ## Security fix This release includes the fix for CVE-2026-105544, an elevation of privilege vulnerability in the VSTest artifact post-processor. The post-processor could consume a forged `executionComplete.json` written by another local user, and then run attacker-controlled output handling. Affected: `Microsoft.TestPlatform.CLI` 18.11.0 and earlier. Every version from 18.11.1 on is fixed, including 18.12.0. `Microsoft.TestPlatform.CLI` is the VSTest build that we ship into the .NET SDK. The recommended way to get this fix is to update your .NET SDK to the latest patched version, see the advisory for the SDK versions. The fix is also released in the `Microsoft.TestPlatform.CLI` package, for completeness. That package is rarely used directly. It is not a dependency of `Microsoft.NET.Test.Sdk` or `Microsoft.TestPlatform`, so those packages do not bring it in. Details: microsoft/vstest#16654 and dotnet/announcements#517 Using custom Docker images or Nano Server? See microsoft/vstest#16652 ## What's Changed * Fix TestCaseStart/Stop events dropped for data-driven tests with shared TestCase.Id by @nohwnd in microsoft/vstest#16033 * Stop the discovery manager factory from shadowing discoveryCriteria by @nohwnd in microsoft/vstest#16391 * Gate the HTTP link checker on a fingerprint of the broken links by @nohwnd in microsoft/vstest#16413 * Quote boolean conditions in shipped Microsoft.TestPlatform.targets by @nohwnd in microsoft/vstest#16404 * Obsolete API hygiene: the compatibility-safe changes by @azat-msft in microsoft/vstest#16420 * Add xxHash128 test ids, available but not default by @azat-msft in microsoft/vstest#16378 * Isolate attachment manager test temporary files by @mmitche in microsoft/vstest#16463 * Test ids report logger by @azat-msft in microsoft/vstest#16443 * Isolate code coverage files in published output by @azat-msft in microsoft/vstest#16483 * Preserve OutputType for Android test projects by @jonathanpeppers in microsoft/vstest#16496 * Fix dotnet host resolution under proot (ARM64/Termux) by @azat-msft in microsoft/vstest#16462 * Mark the xxHash128 test id API as experimental by @azat-msft in microsoft/vstest#16465 * Ship Microsoft.Diagnostics.NETCore.Client in Microsoft.TestPlatform and Portable packages by @nohwnd in microsoft/vstest#16633 * Fix localized resource paths in CLI source-build/non-Windows packages by @nohwnd in microsoft/vstest#16644 **Full Changelog**: microsoft/vstest@v18.11.0...v18.12.0 ## 18.11.1 ## Security fix This release fixes CVE-2026-105544, an elevation of privilege vulnerability in the VSTest artifact post-processor. The post-processor could consume a forged `executionComplete.json` written by another local user, and then run attacker-controlled output handling. Affected: `Microsoft.TestPlatform.CLI` 18.11.0. Fixed in: `Microsoft.TestPlatform.CLI` 18.11.1. `Microsoft.TestPlatform.CLI` is the VSTest build that we ship into the .NET SDK. The recommended way to get this fix is to update your .NET SDK to the latest patched version, see the advisory for the SDK versions. The fix is also released in the `Microsoft.TestPlatform.CLI` package, for completeness. That package is rarely used directly. It is not a dependency of `Microsoft.NET.Test.Sdk` or `Microsoft.TestPlatform`, so those packages do not bring it in. Details: microsoft/vstest#16654 and dotnet/announcements#517 Using custom Docker images or Nano Server? See microsoft/vstest#16652 ## What's Changed * Security fix for CVE-2026-105544, see microsoft/vstest#16654 * Ship Microsoft.Diagnostics.NETCore.Client in Microsoft.TestPlatform and Portable packages by @nohwnd in microsoft/vstest#16632 * Fix localized resource paths in CLI source-build packages by @nohwnd in microsoft/vstest#16643 **Full Changelog**: microsoft/vstest@v18.11.0...v18.11.1 Commits viewable in [compare view](microsoft/vstest@v18.11.0...v18.12.0). </details> Updated [Microsoft.OpenApi](https://github.com/Microsoft/OpenAPI.NET) from 2.13.0 to 2.13.1. <details> <summary>Release notes</summary> _Sourced from [Microsoft.OpenApi's releases](https://github.com/Microsoft/OpenAPI.NET/releases)._ ## 2.13.1 ## [2.13.1](microsoft/OpenAPI.NET@v2.13.0...v2.13.1) (2026-11-16) ### Bug Fixes * **models:** preserve specification extensions in OpenApiPaths and OpenApiResponses copy constructors ([#3162](microsoft/OpenAPI.NET#3162)) ([#3163](microsoft/OpenAPI.NET#3163)) ([3301ba7](microsoft/OpenAPI.NET@3301ba7)) * **models:** preserve tag collection types and comparers in copy constructors ([#3141](microsoft/OpenAPI.NET#3141)) ([#3145](microsoft/OpenAPI.NET#3145)) ([aa5e2b5](microsoft/OpenAPI.NET@aa5e2b5)) * **models:** preserve tag collection types and comparers in OpenApiDocument copy constructor ([aa5e2b5](microsoft/OpenAPI.NET@aa5e2b5)) * **reader:** backport external reference file loading to v2 ([#3174](microsoft/OpenAPI.NET#3174)) ([cb3003a](microsoft/OpenAPI.NET@cb3003a)) * **reader:** backport external reference loading to v2 ([cb3003a](microsoft/OpenAPI.NET@cb3003a)) * Support custom tag ordering and null assignment in OpenApiOperation.Tags ([#3128](microsoft/OpenAPI.NET#3128)) ([#3133](microsoft/OpenAPI.NET#3133)) ([295c89c](microsoft/OpenAPI.NET@295c89c)) * support reinitializing OpenApiOperation.Tags to null and custom comparers ([#3116](microsoft/OpenAPI.NET#3116)) ([#3142](microsoft/OpenAPI.NET#3142)) ([9cfcdd2](microsoft/OpenAPI.NET@9cfcdd2)) * **v2:** map OpenAPI 2.0 response schema type file to binary format ([#3150](microsoft/OpenAPI.NET#3150)) ([#3151](microsoft/OpenAPI.NET#3151)) ([4cf52e1](microsoft/OpenAPI.NET@4cf52e1)) * **v3:** retain full JSON pointer path on OpenAPI 3.0 schema references ([#3155](microsoft/OpenAPI.NET#3155)) ([#3170](microsoft/OpenAPI.NET#3170)) ([16969bc](microsoft/OpenAPI.NET@16969bc)) Commits viewable in [compare view](microsoft/OpenAPI.NET@v2.13.0...v2.13.1). </details> Pinned [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/efcore.pg) at 10.0.4. <details> <summary>Release notes</summary> _Sourced from [Npgsql.EntityFrameworkCore.PostgreSQL's releases](https://github.com/npgsql/efcore.pg/releases)._ ## 10.0.4 [Milestone issue](https://github.com/npgsql/efcore.pg/milestone/79?closed=1) ## What's Changed * [10.0] Backport regex operand parentheses fix by @roji in npgsql/efcore.pg#3928 * [10.0] Remove unused SSL setup from Windows CI by @roji in npgsql/efcore.pg#3931 * [10.0] Backport unnest type mapping inference fix by @roji in npgsql/efcore.pg#3945 * [10.0] Truncate sub-microsecond ticks when formatting TimeSpan as interval by @roji in npgsql/efcore.pg#3947 * [10.0] Preserve row value type mappings when rewriting expressions by @roji in npgsql/efcore.pg#3954 * [10.0] Fix Last() on primitive collections returning the first array element by @roji in npgsql/efcore.pg#3956 * [10.0] Configure row value regression tuple mapping locally by @roji in npgsql/efcore.pg#3960 * [10.0] Update EF Core and other dependencies by @roji in npgsql/efcore.pg#3963 * [10.0] Fix collection conversion with nullable element converters (#3965) by @roji in npgsql/efcore.pg#3967 * [10.0] Fix Contains on an object collection over a value-converted column (#3961) by @roji in npgsql/efcore.pg#3970 * [10.0] Fix tsvector metadata cast for IReadOnlyList by @roji in npgsql/efcore.pg#3986 * [10.0] Fix explicit column types for owned JSON collections by @roji in npgsql/efcore.pg#3989 * [10.0] Prevent PadLeft/PadRight from truncating shorter target widths by @roji in npgsql/efcore.pg#3993 * [10.0] Fix array type inference for mixed collection types by @roji in npgsql/efcore.pg#3996 * [10.0] Fix null checks on unbounded NodaTime Interval bounds by @roji in npgsql/efcore.pg#4002 * [10.0] Backport fix for null propagation in date/time intervals by @roji in npgsql/efcore.pg#4015 * [10.0] Support System.Text.Json serialization of LTree by @roji in npgsql/efcore.pg#4010 * [10.0] Preserve array element converters with explicit column types by @roji in npgsql/efcore.pg#4011 * [10.0] Fix repeated seed-data updates for list properties by @roji in npgsql/efcore.pg#4029 * [10.0] Fix BCE NodaTime SQL literal formatting by @roji in npgsql/efcore.pg#4027 * [10.0] Preserve inherited HiLo sequences in model snapshots by @roji in npgsql/efcore.pg#4032 * [10.0] Fix date/time mapping round-tripping and cloning by @roji in npgsql/efcore.pg#4037 * [10.0] Fix Regex.Replace to replace all matches by @roji in npgsql/efcore.pg#4041 * [10.0] Restore raw JSON byte array mapping by @roji in npgsql/efcore.pg#4044 * [10.0] Translate ToString() on string expressions by @roji in npgsql/efcore.pg#4050 * [10.0] Own newly cloned connections by @roji in npgsql/efcore.pg#4056 * [10.0] Fix type mapping for derived tsquery parameters by @roji in npgsql/efcore.pg#4060 * [10.0] Fix precision-only numeric migration snapshot churn by @roji in npgsql/efcore.pg#4070 * [10.0] Fix byte-array projections from JSON collections by @roji in npgsql/efcore.pg#4073 * [10.0] Fix tsvector columns over JSON-mapped navigations/complex properties by @roji in npgsql/efcore.pg#4076 * [10.0] Fix hstore SQL literal generation for null and escaped values by @roji in npgsql/efcore.pg#4106 * [10.0] Fix TimeOnly.IsBetween for midnight-spanning ranges by @roji in npgsql/efcore.pg#4131 * [10.0] Parenthesize the item of ANY/ALL when its precedence requires it by @roji in npgsql/efcore.pg#4132 * [10.0] Format storage parameter values with the invariant culture by @roji in npgsql/efcore.pg#4133 **Full Changelog**: npgsql/efcore.pg@v10.0.3...v10.0.4 Commits viewable in [compare view](npgsql/efcore.pg@v10.0.3...v10.0.4). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Nov 30, 2026
Merged
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.
Pull Request
Description
This pull request ensures that specification extensions (
Extensions) are preserved when copyingOpenApiPathsandOpenApiResponsesinstances via their copy constructors.Previously,
OpenApiPaths(OpenApiPaths paths)andOpenApiResponses(OpenApiResponses openApiResponses)calledbase(dictionary: ...)without forwarding the existing instance'sExtensions. Because theextensionsparameter defaults tonull,OpenApiExtensibleDictionaryinitializedExtensions = [], dropping any specification extensions configured onPathsorResponses.This also caused
OpenApiDocument(OpenApiDocument document)andOpenApiOperation(OpenApiOperation operation)to lose anyPaths.ExtensionsandResponses.Extensionsduring document or operation cloning.Type of Change
Related Issue(s)
None.
Changes Made
OpenApiPaths(OpenApiPaths paths)to passextensions: paths?.Extensions != null ? new Dictionary<string, IOpenApiExtension>(paths.Extensions) : nullto the base constructor.OpenApiResponses(OpenApiResponses openApiResponses)to passextensions: openApiResponses?.Extensions != null ? new Dictionary<string, IOpenApiExtension>(openApiResponses.Extensions) : nullto the base constructor.OpenApiPathsTestsandOpenApiResponsesTestscovering extensions preservation, dictionary mutation isolation, null parameter handling, and empty extensions handling.OpenApiDocumentTestsandOpenApiOperationTestsverifying that cloning anOpenApiDocumentpreservesPaths.Extensionsand cloning anOpenApiOperationpreservesResponses.Extensions.Testing
Local verification:
dotnet test test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj-> 1322 passed, 0 failed.dotnet test test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj-> 637 passed, 0 failed.Checklist
Versions applicability
See the contributing guidelines for more information about how patches are applied across multiple versions.
Additional Notes
Preserves full backwards compatibility and public API analyzer surface without any breaking changes.