Skip to content

Commit b29caff

Browse files
committed
added schema render to path path param validation
was missing
1 parent 67d7414 commit b29caff

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

parameters/validate_parameter.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,19 @@ func formatJsonSchemaValidationError(schema *base.Schema, scErrs *jsonschema.Val
179179
if er.KeywordLocation == "" || strings.HasPrefix(er.Error, "doesn't validate with") {
180180
continue // ignore this error, it's not useful
181181
}
182-
schemaValidationErrors = append(schemaValidationErrors, &errors.SchemaValidationFailure{
182+
183+
fail := &errors.SchemaValidationFailure{
183184
Reason: er.Error,
184185
Location: er.KeywordLocation,
185186
OriginalError: scErrs,
186-
})
187+
}
188+
if schema != nil {
189+
rendered, err := schema.RenderInline()
190+
if err == nil && rendered != nil {
191+
fail.ReferenceSchema = fmt.Sprintf("%s", rendered)
192+
}
193+
}
194+
schemaValidationErrors = append(schemaValidationErrors, fail)
187195
}
188196
schemaType := "undefined"
189197
if len(schema.Type) > 0 {

0 commit comments

Comments
 (0)