Fix missing __init__.py (#1933)

This commit is contained in:
Jyhess 2019-01-18 05:41:43 +01:00 committed by William Cheng
parent f4133e726d
commit 17218117b9
2 changed files with 13 additions and 0 deletions

View File

@ -45,5 +45,6 @@ public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexion
protected void addSupportingFiles() {
supportingFiles.add(new SupportingFile("conftest.mustache", testPackage, "conftest.py"));
supportingFiles.add(new SupportingFile("__init__test.mustache", testPackage, "__init__.py"));
supportingFiles.add(new SupportingFile("__init__main.mustache", packageName, "__init__.py"));
}
}

View File

@ -0,0 +1,12 @@
import os
import connexion
def main():
options = {
"swagger_ui": True
}
specification_dir = os.path.join(os.path.dirname(__file__), 'openapi')
app = connexion.AioHttpApp(__name__, specification_dir=specification_dir, options=options)
app.add_api('openapi.yaml', arguments={'title': 'OpenAPI Petstore'}, pass_context_arg_name='request')
app.run(port=8080)