Skip to content

Commit

Permalink
feat(): code gen cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Feser <[email protected]>
  • Loading branch information
joefeser committed Aug 10, 2024
1 parent 384648d commit 18302e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ApiGenerator/Generator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class CodeGenerator
public static string CatFormatPropertyGenerator(string type, string name, string key, string setter) =>
$"public {type} {name} {{ "
+ $" get => Q<{type}>(\"{key}\");{Environment.NewLine}"
+ $" set {{ Q(\"{key}\", {setter}); SetAcceptHeader({setter}); }}"
+ $" set {{ Q(\"{key}\", {setter});{Environment.NewLine}SetAcceptHeader({setter}); }}"
+ $"}}";

public static string PropertyGenerator(string type, string name, string key, string setter) =>
Expand Down
1 change: 1 addition & 0 deletions src/ApiGenerator/Views/GeneratorNotice.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* under the License.
*/
</text>}

// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace OpenSearch.Net@(ns)
var names = r.CsharpNames;
<text>
/// <summary>Request options for @names.MethodName@Raw(r.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " <para>" + r.OfficialDocumentationLink + "</para>")</summary>
public partial class @names.ParametersName : RequestParameters<@names.ParametersName>
public partial class @names.ParametersName
: RequestParameters<@names.ParametersName>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.@r.HttpMethod;
public override bool SupportsBody => @(supportsBody ? "true" : "false");
Expand Down

0 comments on commit 18302e3

Please sign in to comment.