forked from loafle/openapi-generator-original
import model only if it has import for c#
This commit is contained in:
parent
488e604207
commit
422da698f6
@ -430,6 +430,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
}
|
||||
|
||||
operations.put("imports", imports);
|
||||
|
||||
// add a flag to indicate whether there's any {{import}}
|
||||
if (imports.size() > 0) {
|
||||
operations.put("hasImport", true);
|
||||
}
|
||||
|
||||
config.postProcessOperations(operations);
|
||||
if (objs.size() > 0) {
|
||||
List<CodegenOperation> os = (List<CodegenOperation>) objs.get("operation");
|
||||
|
@ -4,13 +4,11 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using RestSharp;
|
||||
using {{packageName}}.Client;
|
||||
using {{packageName}}.Model;
|
||||
{{#imports}}
|
||||
{{/imports}}
|
||||
{{#hasImport}}using {{packageName}}.Model;
|
||||
{{/hasImport}}
|
||||
|
||||
namespace {{packageName}}.Api {
|
||||
{{#operations}}
|
||||
|
||||
public interface I{{classname}} {
|
||||
{{#operation}}
|
||||
/// <summary>
|
||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Api {
|
||||
|
||||
|
||||
public interface IPetApi {
|
||||
|
||||
/// <summary>
|
||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Api {
|
||||
|
||||
|
||||
public interface IStoreApi {
|
||||
|
||||
/// <summary>
|
||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Api {
|
||||
|
||||
|
||||
public interface IUserApi {
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user