Skip to content

Commit f6d1b8c

Browse files
authored
fix after #870: make sure Bis does not surface up (#878)
1 parent 0cc5e22 commit f6d1b8c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openapi2/marsh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
)
1010

1111
func unmarshalError(jsonUnmarshalErr error) error {
12-
if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis."); found && before != "" && after != "" {
12+
if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis"); found && before != "" && after != "" {
1313
before = strings.ReplaceAll(before, " Go struct ", " ")
14-
return fmt.Errorf("%s.%s", before, after)
14+
return fmt.Errorf("%s%s", before, strings.ReplaceAll(after, "Bis", ""))
1515
}
1616
return jsonUnmarshalErr
1717
}

openapi3/marsh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
)
1010

1111
func unmarshalError(jsonUnmarshalErr error) error {
12-
if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis."); found && before != "" && after != "" {
12+
if before, after, found := strings.Cut(jsonUnmarshalErr.Error(), "Bis"); found && before != "" && after != "" {
1313
before = strings.ReplaceAll(before, " Go struct ", " ")
14-
return fmt.Errorf("%s.%s", before, after)
14+
return fmt.Errorf("%s%s", before, strings.ReplaceAll(after, "Bis", ""))
1515
}
1616
return jsonUnmarshalErr
1717
}

0 commit comments

Comments
 (0)