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);
|
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);
|
config.postProcessOperations(operations);
|
||||||
if (objs.size() > 0) {
|
if (objs.size() > 0) {
|
||||||
List<CodegenOperation> os = (List<CodegenOperation>) objs.get("operation");
|
List<CodegenOperation> os = (List<CodegenOperation>) objs.get("operation");
|
||||||
|
@ -4,13 +4,11 @@ using System.Collections.Generic;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
using {{packageName}}.Client;
|
using {{packageName}}.Client;
|
||||||
using {{packageName}}.Model;
|
{{#hasImport}}using {{packageName}}.Model;
|
||||||
{{#imports}}
|
{{/hasImport}}
|
||||||
{{/imports}}
|
|
||||||
|
|
||||||
namespace {{packageName}}.Api {
|
namespace {{packageName}}.Api {
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
|
|
||||||
public interface I{{classname}} {
|
public interface I{{classname}} {
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
|||||||
|
|
||||||
namespace IO.Swagger.Api {
|
namespace IO.Swagger.Api {
|
||||||
|
|
||||||
|
|
||||||
public interface IPetApi {
|
public interface IPetApi {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
|||||||
|
|
||||||
namespace IO.Swagger.Api {
|
namespace IO.Swagger.Api {
|
||||||
|
|
||||||
|
|
||||||
public interface IStoreApi {
|
public interface IStoreApi {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -8,7 +8,6 @@ using IO.Swagger.Model;
|
|||||||
|
|
||||||
namespace IO.Swagger.Api {
|
namespace IO.Swagger.Api {
|
||||||
|
|
||||||
|
|
||||||
public interface IUserApi {
|
public interface IUserApi {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user