Skip to content

Commit 4a74e78

Browse files
committed
fix python flask controller without tag (default_controller)
1 parent 40a1879 commit 4a74e78

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ public void processOpts() {
145145
}
146146

147147
if(!new java.io.File(controllerPackage + File.separator + defaultController + ".py").exists()) {
148-
//supportingFiles.add(new SupportingFile("controller.mustache",
149-
// controllerPackage,
150-
// defaultController + ".py")
151-
//);
152148
supportingFiles.add(new SupportingFile("__init__.mustache",
153149
controllerPackage,
154150
"__init__.py")
@@ -269,7 +265,7 @@ public void preprocessSwagger(Swagger swagger) {
269265
}
270266
else {
271267
// no tag found, use "default_controller" as the default
272-
String tag = "default_controller";
268+
String tag = "default";
273269
operation.setTags(Arrays.asList(tag));
274270
controllerName = tag + "_controller";
275271
}

samples/server/petstore/flaskConnexion/swagger/swagger.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ definitions:
644644
complete:
645645
type: "boolean"
646646
default: false
647+
title: "Pet Order"
648+
description: "An order for a pets from the pet store"
647649
xml:
648650
name: "Order"
649651
Category:
@@ -654,6 +656,8 @@ definitions:
654656
format: "int64"
655657
name:
656658
type: "string"
659+
title: "Pet catehgry"
660+
description: "A category for a pet"
657661
xml:
658662
name: "Category"
659663
User:
@@ -678,6 +682,8 @@ definitions:
678682
type: "integer"
679683
format: "int32"
680684
description: "User Status"
685+
title: "a User"
686+
description: "A User who is purchasing from the pet store"
681687
xml:
682688
name: "User"
683689
Tag:
@@ -688,6 +694,8 @@ definitions:
688694
format: "int64"
689695
name:
690696
type: "string"
697+
title: "Pet Tag"
698+
description: "A tag for a pet"
691699
xml:
692700
name: "Tag"
693701
Pet:
@@ -725,6 +733,8 @@ definitions:
725733
- "available"
726734
- "pending"
727735
- "sold"
736+
title: "a Pet"
737+
description: "A pet for sale in the pet store"
728738
xml:
729739
name: "Pet"
730740
ApiResponse:
@@ -737,6 +747,8 @@ definitions:
737747
type: "string"
738748
message:
739749
type: "string"
750+
title: "An uploaded response"
751+
description: "Describes the result of uploading an image resource"
740752
externalDocs:
741753
description: "Find out more about Swagger"
742754
url: "http://swagger.io"

0 commit comments

Comments
 (0)