Skip to content

Commit 8f6e81d

Browse files
committed
Implement IUrlParameter on Time (#3222)
* Implement IUrlParameter on Time This commit implements IUrlParameter on Time so that the conversion to a string value happens when building the url. Add condition to ElasticsearchUrlFormatter to convert TimeSpan to Time unit string value when building the url. Remove special case handling for Time and TimeSpan and re-run API generation Fixes #3220
1 parent 948cbb1 commit 8f6e81d

File tree

7 files changed

+350
-336
lines changed

7 files changed

+350
-336
lines changed

src/CodeGeneration/ApiGenerator/Domain/ApiQueryParameters.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,9 @@ public string TypeHighLevel
4848
public string ClsArgumentName => this.ClsName.ToCamelCase();
4949
public string DescriptorArgumentType =>
5050
this.Type == "list" && this.TypeHighLevel.EndsWith("[]") ? "params " + this.TypeHighLevel : TypeHighLevel;
51-
public string SetterHighLevel
52-
{
53-
get
54-
{
55-
var setter = "value";
56-
if (this.TypeHighLevel == "Time") setter += ".ToString()";
57-
return setter;
58-
}
59-
}
60-
public string SetterLowLevel
61-
{
62-
get
63-
{
64-
var setter = "value";
65-
if (this.TypeLowLevel == "TimeSpan") setter += ".ToTimeUnit()";
66-
return setter;
67-
}
68-
}
51+
public string SetterHighLevel => "value";
52+
53+
public string SetterLowLevel => "value";
6954

7055
public bool IsFieldsParam => this.TypeHighLevel == "Fields";
7156
public bool IsFieldParam => this.TypeHighLevel == "Field";

0 commit comments

Comments
 (0)