Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #629 +/- ##
=======================================
Coverage 99.78% 99.78%
=======================================
Files 283 283
Lines 34456 34460 +4
=======================================
+ Hits 34382 34386 +4
Misses 46 46
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
#628 -
additionalOperationsfrom the OpenApi 3.2 spec are dropped during a parse/render round-trip.Cause
PathItem.Buildonly setValueonAdditionalOperations, leavingKeyNodeandValueNodenil.NodeReference.IsEmpty()only looks at the nodes, so the high-level model treated the field as empty even when the map had operations in it. Any spec parsed from YAML silently lost its additional operations. They are missing from the high-levelPathItem, fromGetOperations(), and from rendered output.Fix
The fix captures the key and value nodes when the map is first created and sets them on the reference. With an
additionalOperationscontainer, that's the container's own key and value. With bare method keys there is no container, so it's the first additional operation found.Testing
The two existing tests in
datamodel/high/v3both parse the YAML throughBuild()but were hiding the bug.TestPathItem_WithAdditionalOperationsreplaced whatBuild()produced with a hand-built low-level reference that had the nodes set, under a comment sayingBuild()doesn't handleadditionalOperations. It does, it just didn't set the nodes. The hand-built block was removed and the test now uses the referenceBuild()returns.TestPathItem_AdditionalOperationswrapped every assertion in anIsEmpty()check that, due to the bug, prevented the meaningful assertions from running. The check is removed and replaced by an assertion that it is NOT empty instead of skipping the AdditionalOperations validation.