-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Generated Client does not include authInfo as second parameter
I want to include a bearer token as a Authentication header For each request I make with the generated go-swagger client.
Examples I've seen is doing something like this:
auth := httptransport.BearerToken(rawToken), nil
client.cart.CancelCart(params, auth)
Where the different methods takes authInfo of type runtime.ClientAuthInfoWriter as a second parameter like this:
type ClientService interface {
CancelCart(params *CancelCartParams, authInfo runtime.ClientAuthInfoWriter) (*CancelCartOK, error)
}
However in my generated client it looks like this:
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
type ClientService interface {
CancelCart(params *CancelCartParams, opts ...ClientOption) (*CancelCartOK, error)
}
Why don't I get authInfo as a second parameter?
Is it possible to achieve the same goal the way my client is generated?
Swagger specification
Client generated with a swagger specification of version 2.0
Environment
swagger version: 0.26.1
go version: 1.16.4
amnid
Metadata
Metadata
Assignees
Labels
No labels