diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index a9456a6cb4..c5fd452572 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -42,6 +42,11 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { endpoint.URL.Paths = append(endpoint.URL.Paths, p.Path) } + // Add Path when it's empty + if endpoint.URL.Path == "" { + endpoint.URL.Path = endpoint.URL.Paths[0] + } + for partName, p := range endpoint.URL.Parts { p.Endpoint = &endpoint p.Name = partName