diff --git a/openapi2/marsh.go b/openapi2/marsh.go index 6a9df466c..b15f3b82c 100644 --- a/openapi2/marsh.go +++ b/openapi2/marsh.go @@ -9,9 +9,9 @@ import ( ) func unmarshalError(jsonUnmarshalErr error) error { - if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis."); found && before != "" && after != "" { + if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis"); found && before != "" && after != "" { before = strings.ReplaceAll(before, " Go struct ", " ") - return fmt.Errorf("%s.%s", before, after) + return fmt.Errorf("%s%s", before, strings.ReplaceAll(after, "Bis", "")) } return jsonUnmarshalErr } diff --git a/openapi3/marsh.go b/openapi3/marsh.go index 5ef69ae8b..18036ae78 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -9,9 +9,9 @@ import ( ) func unmarshalError(jsonUnmarshalErr error) error { - if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis."); found && before != "" && after != "" { + if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis"); found && before != "" && after != "" { before = strings.ReplaceAll(before, " Go struct ", " ") - return fmt.Errorf("%s.%s", before, after) + return fmt.Errorf("%s%s", before, strings.ReplaceAll(after, "Bis", "")) } return jsonUnmarshalErr }