From 68cccdd413d978a26d7dee957930648f4d50cfda Mon Sep 17 00:00:00 2001 From: Andrey Golikov Date: Sat, 6 Sep 2025 00:07:20 +0300 Subject: [PATCH 1/4] add GetAllPath --- pkg/codegen/templates/client.tmpl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/codegen/templates/client.tmpl b/pkg/codegen/templates/client.tmpl index 822e11097a..32dba67517 100644 --- a/pkg/codegen/templates/client.tmpl +++ b/pkg/codegen/templates/client.tmpl @@ -85,6 +85,9 @@ type ClientInterface interface { {{end -}} {{end}}{{/* range .Bodies */}} {{end}}{{/* range . $opid := .OperationId */}} + + // GetAllPath returns all available paths. + GetAllPath() []string } @@ -310,3 +313,11 @@ func (c *{{ $clientTypeName }}) applyEditors(ctx context.Context, req *http.Requ } return nil } + +func (c *{{ $clientTypeName }}) GetAllPath() []string { + return []string{ + {{range . -}} + "{{.Path}}", + {{end}} + } +} From f3ec91a8b25edf61ce56aa9eb249f0027f83b5fe Mon Sep 17 00:00:00 2001 From: Andrey Golikov Date: Sat, 6 Sep 2025 00:16:37 +0300 Subject: [PATCH 2/4] delete link --- pkg/codegen/templates/client.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/codegen/templates/client.tmpl b/pkg/codegen/templates/client.tmpl index 32dba67517..5966db7848 100644 --- a/pkg/codegen/templates/client.tmpl +++ b/pkg/codegen/templates/client.tmpl @@ -314,7 +314,7 @@ func (c *{{ $clientTypeName }}) applyEditors(ctx context.Context, req *http.Requ return nil } -func (c *{{ $clientTypeName }}) GetAllPath() []string { +func (c {{ $clientTypeName }}) GetAllPath() []string { return []string{ {{range . -}} "{{.Path}}", From abaa4713914d54ffd80f1c716af5bc49f7b6420b Mon Sep 17 00:00:00 2001 From: Andrey Golikov Date: Mon, 8 Sep 2025 11:04:04 +0300 Subject: [PATCH 3/4] update code --- pkg/codegen/templates/client.tmpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/codegen/templates/client.tmpl b/pkg/codegen/templates/client.tmpl index 5966db7848..30376964ec 100644 --- a/pkg/codegen/templates/client.tmpl +++ b/pkg/codegen/templates/client.tmpl @@ -86,8 +86,6 @@ type ClientInterface interface { {{end}}{{/* range .Bodies */}} {{end}}{{/* range . $opid := .OperationId */}} - // GetAllPath returns all available paths. - GetAllPath() []string } @@ -314,7 +312,8 @@ func (c *{{ $clientTypeName }}) applyEditors(ctx context.Context, req *http.Requ return nil } -func (c {{ $clientTypeName }}) GetAllPath() []string { + // GetAllPath returns all available paths. +func GetAllPath() []string { return []string{ {{range . -}} "{{.Path}}", From ad18f2e01b5bbdeaae2d24aff40c14839e511e7e Mon Sep 17 00:00:00 2001 From: Andrey Golikov Date: Thu, 11 Sep 2025 10:20:23 +0300 Subject: [PATCH 4/4] add ClientServiceInterface --- pkg/codegen/templates/client-with-responses.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/codegen/templates/client-with-responses.tmpl b/pkg/codegen/templates/client-with-responses.tmpl index 3b85500a8d..4e6db15b2a 100644 --- a/pkg/codegen/templates/client-with-responses.tmpl +++ b/pkg/codegen/templates/client-with-responses.tmpl @@ -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) {