@@ -47,6 +47,9 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
4747 submittedSegments := strings .Split (paths .StripRequestPath (request , v .document ), helpers .Slash )
4848 pathSegments := strings .Split (pathValue , helpers .Slash )
4949
50+ // get the operation method for error reporting
51+ operation := strings .ToLower (request .Method )
52+
5053 // extract params for the operation
5154 params := helpers .ExtractParamsForOperation (request , pathItem )
5255 var validationErrors []* errors.ValidationError
@@ -176,7 +179,7 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
176179 break
177180 }
178181 validationErrors = append (validationErrors ,
179- ValidateSingleParameterSchema (
182+ ValidateSingleParameterSchemaWithPath (
180183 sch ,
181184 decodedParamValue ,
182185 "Path parameter" ,
@@ -185,6 +188,8 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
185188 helpers .ParameterValidation ,
186189 helpers .ParameterValidationPath ,
187190 v .options ,
191+ pathValue ,
192+ operation ,
188193 )... )
189194
190195 case helpers .Integer :
@@ -199,7 +204,7 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
199204 enumCheck (rawParamValue )
200205 break
201206 }
202- validationErrors = append (validationErrors , ValidateSingleParameterSchema (
207+ validationErrors = append (validationErrors , ValidateSingleParameterSchemaWithPath (
203208 sch ,
204209 paramValueParsed ,
205210 "Path parameter" ,
@@ -208,6 +213,8 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
208213 helpers .ParameterValidation ,
209214 helpers .ParameterValidationPath ,
210215 v .options ,
216+ pathValue ,
217+ operation ,
211218 )... )
212219
213220 case helpers .Number :
@@ -222,7 +229,7 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
222229 enumCheck (rawParamValue )
223230 break
224231 }
225- validationErrors = append (validationErrors , ValidateSingleParameterSchema (
232+ validationErrors = append (validationErrors , ValidateSingleParameterSchemaWithPath (
226233 sch ,
227234 paramValueParsed ,
228235 "Path parameter" ,
@@ -231,6 +238,8 @@ func (v *paramValidator) ValidatePathParamsWithPathItem(request *http.Request, p
231238 helpers .ParameterValidation ,
232239 helpers .ParameterValidationPath ,
233240 v .options ,
241+ pathValue ,
242+ operation ,
234243 )... )
235244
236245 case helpers .Boolean :
0 commit comments