fix python flask controller without tag (default_controller)

This commit is contained in:
wing328 2016-10-03 09:32:20 +08:00
parent 40a1879797
commit 4a74e788ec
2 changed files with 13 additions and 5 deletions

View File

@ -145,10 +145,6 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
}
if(!new java.io.File(controllerPackage + File.separator + defaultController + ".py").exists()) {
//supportingFiles.add(new SupportingFile("controller.mustache",
// controllerPackage,
// defaultController + ".py")
//);
supportingFiles.add(new SupportingFile("__init__.mustache",
controllerPackage,
"__init__.py")
@ -269,7 +265,7 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
}
else {
// no tag found, use "default_controller" as the default
String tag = "default_controller";
String tag = "default";
operation.setTags(Arrays.asList(tag));
controllerName = tag + "_controller";
}

View File

@ -644,6 +644,8 @@ definitions:
complete:
type: "boolean"
default: false
title: "Pet Order"
description: "An order for a pets from the pet store"
xml:
name: "Order"
Category:
@ -654,6 +656,8 @@ definitions:
format: "int64"
name:
type: "string"
title: "Pet catehgry"
description: "A category for a pet"
xml:
name: "Category"
User:
@ -678,6 +682,8 @@ definitions:
type: "integer"
format: "int32"
description: "User Status"
title: "a User"
description: "A User who is purchasing from the pet store"
xml:
name: "User"
Tag:
@ -688,6 +694,8 @@ definitions:
format: "int64"
name:
type: "string"
title: "Pet Tag"
description: "A tag for a pet"
xml:
name: "Tag"
Pet:
@ -725,6 +733,8 @@ definitions:
- "available"
- "pending"
- "sold"
title: "a Pet"
description: "A pet for sale in the pet store"
xml:
name: "Pet"
ApiResponse:
@ -737,6 +747,8 @@ definitions:
type: "string"
message:
type: "string"
title: "An uploaded response"
description: "Describes the result of uploading an image resource"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"