Skip to content

Commit

Permalink
update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Apr 5, 2024
1 parent d7fedc0 commit 7cef6ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rest/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ func (c *RESTConnector) encodeParameterValues(param *rest.RequestParameter, argu
return []*internal.StringSlicePair{
internal.NewStringSlicePair([]string{}, []string{fmt.Sprintf("%t", value)}),
}, nil
case *schema.TypeRepresentationNumber, *schema.TypeRepresentationInteger, *schema.TypeRepresentationString:
return []*internal.StringSlicePair{
internal.NewStringSlicePair([]string{}, []string{fmt.Sprint(value)}),
}, nil
case *schema.TypeRepresentationEnum:
val = fmt.Sprint(value)
if !slices.Contains(ty.OneOf, val) {
return nil, fmt.Errorf("%s: invalid enum value '%s'", param.Name, value)
}

return []*internal.StringSlicePair{internal.NewStringSlicePair([]string{}, []string{fmt.Sprint(value)})}, nil
default:
return []*internal.StringSlicePair{
internal.NewStringSlicePair([]string{}, []string{fmt.Sprint(value)}),
}, nil
}
}

Expand Down

0 comments on commit 7cef6ce

Please sign in to comment.