Commit c23baaf
authored
Fixed bug in methods which hit "apis/{group}/..." url (#741)
* Moved _url.Replace("/apis//", "/api/") down several lines.
Consider the following code:
var _baseUrl = BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").ToString();
_url = _url.Replace("/apis//", "/api/");
_url = _url.Replace("{group}", group);
_url = _url.Replace("{version}", version);
_url = _url.Replace("{namespace}", namespaceParameter);
_url = _url.Replace("{plural}", plural);
If group is empty string, we need to replace /apis// with /api.
To do this, we need to replace /apis// after {group}.
Code after the change:
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").ToString();
_url = _url.Replace("{group}", group);
_url = _url.Replace("{version}", version);
_url = _url.Replace("{namespace}", namespaceParameter);
_url = _url.Replace("{plural}", plural);
_url = _url.Replace("/apis//", "/api/");
* Auto-generated changes1 parent 7a02486 commit c23baaf
File tree
2 files changed
+553
-553
lines changed- gen/KubernetesGenerator/templates
- src/KubernetesClient/generated
2 files changed
+553
-553
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments