From 41e4fc79ae184e90e26bcc06cf31006e0086d804 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Fri, 29 May 2015 12:19:28 +0200 Subject: [PATCH] Extended the api-class generation by a interface generation --- .../src/main/resources/csharp/api.mustache | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index 50e80ae6497..bf7da6efdb8 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -9,7 +9,16 @@ using {{modelPackage}}; namespace {{package}} { {{#operations}} - public class {{classname}} { + + public interface I{{classname}} { + {{#operation}} + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + {{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} + } + + public class {{classname}} : I{{classname}} { string basePath; protected RestClient restClient;