Repository navigation
fix(models): preserve tag collection types and comparers in copy constructors - #3141
Conversation
|
Hi Vincent Biret (@baywet)! Following up on the custom tag collection support in #3128, this PR ensures that copy constructors in both OpenApiOperation and OpenApiDocument also preserve custom tag collection types (SortedSet, custom comparer HashSet, ImmutableSortedSet) and maintain collection deep-copy isolation. Unit tests covering all scenarios are included. Whenever you have a moment, please take a look. Thank you! |
|
Hardik K (@hardikkaurani) can you please solve the conflicts here? |
|
Vincent Biret (@baywet) Yes thanks for the review ! Just doing the chnages. |
28b65dd to
d9f48dd
Compare
|
I have rebased the branch onto the latest \main\ and resolved the conflicts caused by the squash-merge of #3128. The branch is now clean and up to date. Thank you! |
d9f48dd to
28b65dd
Compare
|
I have updated the PR in commit 9730962 addressing your review feedback:
Ready for your review! Thank you! |
|
Hardik K (@hardikkaurani) can you please solve the conflicts? (there were multiple parallel PRs on this topic, keep the minimal amount of changes in this PR) |
…cument copy constructor
9730962 to
eb6ec97
Compare
|
I have rebased the branch onto the latest As suggested, since #3116 was merged and already handles
The PR is now clean, minimal, and mergeable. Ready for your review! Thank you! |
Summary
When copying an \OpenApiOperation\ or \OpenApiDocument\ via copy constructors (
ew OpenApiOperation(operation)\ /
ew OpenApiDocument(document)), the \Tags\ property was previously converted into a default
ew HashSet(...)\ /
ew HashSet(...).
This caused two issues:
ew HashSet(operation.Tags)\ did not pass \OpenApiTagComparer.Instance, causing an unnecessary secondary re-allocation in the \Tags\ property setter.
Changes