Closed reuvenharrison closed 9 months ago
Attention: 20 lines
in your changes are missing coverage. Please review.
Comparison is base (
a8392c1
) 83.75% compared to head (c7e9aaf
) 83.85%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This branch implements a new delta function for OpenAPI spec. The delta function returns a numeric value between 0 and 1 representing the distance between base and revision specs. For any spec, a:
delta(a, a) = 0
For any two specs, a and b, with no common elements:delta(a, b) = 1
Delta is symmetric by default: For any two specs, a and b:
delta(a, b) = delta(b, a)
Delta can also be asymmetric so that it only considers elements of base that are deleted in revision but not elements of base that are added in revision. For any two specs, a and b:
asymmetricDelta(a, b) + asymmetricDelta(b, a) = 1
In order to implement delta, we need to traverse the diff tree. We will implement this until all elements are covered.
Each diff element that is supported by delta must have a new
Unchanged
member that allows delta to know how many items were unchanged. Note that the newUnchanged
member will also appear in theoasdiff diff
output when diff is not empty. We will implement this gradually until all elements are covered.To test delta:
oasdiff delta data/simple4.yaml data/simple3.yaml
To test asymmetric delta:
oasdiff delta data/simple4.yaml data/simple3.yaml --asymmetric
To see the new Unchanged fields:
oasdiff diff data/simple4.yaml data/simple3.yaml