Closed fredbi closed 6 months ago
Attention: Patch coverage is 87.38462%
with 41 lines
in your changes are missing coverage. Please review.
Project coverage is 92.53%. Comparing base (
fb01d6d
) to head (7b1fec1
). Report is 4 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
schema_props.go | 86.06% | 9 Missing and 8 partials :warning: |
spec.go | 78.57% | 3 Missing and 3 partials :warning: |
validator.go | 90.19% | 4 Missing and 1 partial :warning: |
default_validator.go | 75.00% | 2 Missing and 2 partials :warning: |
example_validator.go | 75.00% | 2 Missing and 2 partials :warning: |
result.go | 50.00% | 3 Missing :warning: |
formats.go | 66.66% | 1 Missing :warning: |
slice_validator.go | 66.66% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
fixes
a memory leak with recycled *Result in schema_props.go was causing some invalid results when GC is under pressure (seen on go-swagger test)
refactored schema props to isolate anyOf, oneOf, allOf, etc.
made the validation logic a little clearer to follow
fixed leaks with unreleased allocated Results
ensured that child validators for schemaPropsValidator cannot be reused after they are exhausted
ensured that recyclable results are redeemed in all cases in default and example validators
with go1.22, the race detector figured a race condition when expanding the swagger schema for parameters (spec.go)
before iterating over parameters to validate the swagger schema for a parameter, deep clone the schema from the root spec. This is performed once for a spec, so the perf impact should be negligible
tests
Signed-off-by: Frederic BIDON fredbi@yahoo.com