Commit Graph

14 Commits

Author SHA1 Message Date
Vladimir Khvostov
c23baaf3e8 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 changes
2021-11-02 12:41:32 -07:00
Boshi Lian
ae591580b6 fix build (#734)
* fix build

* eliminate warnings
2021-10-24 08:14:22 -07:00
Vladimir Khvostov
e7de93dd10 Made a change to avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream. (#731)
* Avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream

Made a change to avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream, which significantly reduced memory utilization.
Created Kubernetes.cs file and moved constructors and couple methods from the Kubernetes.cs.template to the Kubernetes.cs

Generated Kubernetes.cs will be in a separate commit.

* Separate commit for generated Kubernetes.cs
2021-10-20 06:55:58 -07:00
Boshi Lian
43f8922d20 Upgrade generator dep (#730)
* catch up nswag

* fix changes due to api change

* nustache as well
2021-10-20 06:53:59 -07:00
Boshi Lian
fb553c5c0d refactor generator code (#727)
* refactor generator code

* remove unused files

* dotnet fmt
2021-10-14 06:55:19 -07:00
Boshi Lian
bc11d3aec2 httpclient to support different timeout for watch and regular api (#725)
* api for httpclient timeout

* testcases for global timeout

* update timeout to honor token

* generated files
2021-10-11 12:55:02 -07:00
Boshi Lian
78387dc44f Fix 718 url not relative to baseuri (#724)
* trim starting / for api path

* regenerate with api path
2021-10-11 12:53:02 -07:00
Boshi Lian
463e2d94df Fix 712 (#713)
* fix iter obj validate might npe

* generated models
2021-09-24 19:34:21 -07:00
Boshi Lian
7bbf6aa374 Fix 710 (#711)
* fix template body not included

* new generated file

* trim unused ref
2021-09-21 15:48:48 -07:00
Boshi Lian
6eea70326d Inline tweak handler (#706)
* move tweak handler to template

* generated code

* remove handler from api
2021-09-17 08:23:01 -07:00
Boshi Lian
07ab21bb98 Fix log return disposed obj (#705)
* generator not to dispose stream

* new generated code

* test to cover log stream
2021-09-17 08:21:00 -07:00
Boshi Lian
b9032960e9 Inline watcher (#681)
* ignore more files

* inline watcher

* remove watcher handler

* generated files

* mark LineSeparatedHttpContent internal

* method removed

* fix warning
2021-09-14 11:20:05 -07:00
Boshi Lian
d66c914c86 Gen v1.22.0 (#677)
* generator to support bool?

* gen v1.22.0

* trim version convertor

* bump ver
2021-08-15 09:01:46 -07:00
Boshi Lian
b8f78e4641 port autorest2 template to local generate tools (#669)
* port autorest to watch generator

* rename KubernetesWatchGenerator -> KubernetesGenerator

* add validate

* fix format

* fix generate code warnings

* fix line ending

* fix missing property found by comp check

* do not new http method
2021-08-09 07:27:32 -07:00