Skip to content

Commit 41e4fc7

Browse files
author
Fredrik Gustafsson
committed
Extended the api-class generation by a interface generation
1 parent 049299f commit 41e4fc7

File tree

1 file changed

+10
-1
lines changed
  • modules/swagger-codegen/src/main/resources/csharp

1 file changed

+10
-1
lines changed

modules/swagger-codegen/src/main/resources/csharp/api.mustache

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ using {{modelPackage}};
99

1010
namespace {{package}} {
1111
{{#operations}}
12-
public class {{classname}} {
12+
13+
public interface I{{classname}} {
14+
{{#operation}}
15+
{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
16+
17+
{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
18+
{{/operation}}
19+
}
20+
21+
public class {{classname}} : I{{classname}} {
1322
string basePath;
1423
protected RestClient restClient;
1524

0 commit comments

Comments
 (0)