Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed memory leak & race issues
* 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 * added test for go-swagger fixture #2866, which exhibits the failure with the highest probability * ensured that child validators for schemaPropsValidator cannot be reused after they are exhausted * with go1.22, the race detector figured a race condition when expanding the swagger schema for parameters (spec.go) * fix: 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 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
- Loading branch information