Fix empty ValidationError.ParameterName#218
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the ParameterName field in ValidationError was not being set by most parameter error methods, causing it to be empty. The fix ensures that all parameter validation error functions now correctly populate the ParameterName field with param.Name.
Changes:
- Added
ParameterName: param.Nameto 28 parameter error functions inerrors/parameter_errors.go - Added corresponding test assertions to verify
ParameterNameis correctly set in all affected test cases
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| errors/parameter_errors.go | Added ParameterName field assignment to 28 parameter validation error functions that were missing it |
| errors/parameter_errors_test.go | Added 40 test assertions to verify ParameterName is correctly populated in all affected validation error tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 97.58% 97.60% +0.01%
==========================================
Files 56 56
Lines 5176 5209 +33
==========================================
+ Hits 5051 5084 +33
Misses 125 125
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
cc @daveshanley for visibility |
daveshanley
left a comment
There was a problem hiding this comment.
LGTM! thank you for addressing this.
Most methods for parameter errors were not setting
ParameterName, causing the field to be empty most of the time.This PR fixes this by making sure that
ParameterNameis always set for a parameterValidationError.