Skip to content

Commit 7286ec2

Browse files
Jyhesswing328
authored andcommitted
Fix missing __init__.py (OpenAPITools#1933)
1 parent 87ccff9 commit 7286ec2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ public String getName() {
4545
protected void addSupportingFiles() {
4646
supportingFiles.add(new SupportingFile("conftest.mustache", testPackage, "conftest.py"));
4747
supportingFiles.add(new SupportingFile("__init__test.mustache", testPackage, "__init__.py"));
48+
supportingFiles.add(new SupportingFile("__init__main.mustache", packageName, "__init__.py"));
4849
}
4950
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
import connexion
3+
4+
5+
def main():
6+
options = {
7+
"swagger_ui": True
8+
}
9+
specification_dir = os.path.join(os.path.dirname(__file__), 'openapi')
10+
app = connexion.AioHttpApp(__name__, specification_dir=specification_dir, options=options)
11+
app.add_api('openapi.yaml', arguments={'title': 'OpenAPI Petstore'}, pass_context_arg_name='request')
12+
app.run(port=8080)

0 commit comments

Comments
 (0)