Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/codegen/templates/client-with-responses.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ type ClientWithResponses struct {
ClientInterface
}

// The common interface
type ClientServiceInterface interface {
ClientInterface
ClientWithResponsesInterface
}


// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
Expand Down
10 changes: 10 additions & 0 deletions pkg/codegen/templates/client.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type ClientInterface interface {
{{end -}}
{{end}}{{/* range .Bodies */}}
{{end}}{{/* range . $opid := .OperationId */}}

}


Expand Down Expand Up @@ -310,3 +311,12 @@ func (c *{{ $clientTypeName }}) applyEditors(ctx context.Context, req *http.Requ
}
return nil
}

// GetAllPath returns all available paths.
func GetAllPath() []string {
return []string{
{{range . -}}
"{{.Path}}",
{{end}}
}
}