@@ -40,17 +40,19 @@ func ValidateOpenAPIDocument(doc libopenapi.Document) (bool, []*errors.Validatio
4040
4141 for q := range schFlatErrs {
4242 er := schFlatErrs [q ]
43- if er .KeywordLocation == "" || strings .HasPrefix (er .Error , "doesn't validate with" ) {
43+ if er .KeywordLocation == "" ||
44+ strings .HasPrefix (er .Error , "oneOf failed" ) ||
45+ strings .HasPrefix (er .Error , "allOf failed" ) ||
46+ strings .HasPrefix (er .Error , "anyOf failed" ) ||
47+ strings .HasPrefix (er .Error , "if failed" ) ||
48+ strings .HasPrefix (er .Error , "else failed" ) ||
49+ strings .HasPrefix (er .Error , "doesn't validate with" ) {
4450 continue // ignore this error, it's useless tbh, utter noise.
4551 }
4652 if er .Error != "" {
4753
4854 // locate the violated property in the schema
49- located := LocateSchemaPropertyNodeByJSONPath (info .RootNode .Content [0 ], er .KeywordLocation )
50- if located == nil {
51- // try again with the instance location
52- located = LocateSchemaPropertyNodeByJSONPath (info .RootNode .Content [0 ], er .InstanceLocation )
53- }
55+ located := LocateSchemaPropertyNodeByJSONPath (info .RootNode .Content [0 ], er .InstanceLocation )
5456 violation := & errors.SchemaValidationFailure {
5557 Reason : er .Error ,
5658 Location : er .InstanceLocation ,
0 commit comments