Skip to content

Commit d478267

Browse files
committed
Minor fixes
1 parent d0a53ad commit d478267

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

examples/microservice_swagger/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
- "test"
3333
summary: "Example endpoint"
3434
description: ""
35-
operationId: "examples.mininum_microservice.views.example"
35+
operationId: "examples.microservice_swagger.views.example"
3636
consumes:
3737
- "application/json"
3838
produces:

pyms/flask/app/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ def init_logger(self):
4545
self.application.logger.propagate = False
4646
self.application.logger.setLevel(logging.INFO)
4747

48-
def init_app(self):
48+
def init_app(self) -> Flask:
4949
if getattr(self, "swagger", False):
5050
app = connexion.App(__name__, specification_dir=os.path.join(self.path, self.swagger.path))
5151
app.add_api(self.swagger.file,
5252
arguments={'title': self.config.APP_NAME},
5353
base_path=self.config.APPLICATION_ROOT
5454
)
5555

56+
# Invert the objects, instead connexion with a Flask object, a Flask object with
5657
application = app.app
5758
application._connexion_app = app
5859
else:

pyms/flask/services/driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
logger = logging.getLogger(LOGGER_NAME)
88

9+
910
class DriverService:
1011
service = ""
1112

@@ -27,7 +28,7 @@ def __init__(self, service=None):
2728
self.config = get_conf(service=self.service, empty_init=True)
2829

2930
def get_services(self):
30-
return ((k, self.get_service(k)) for k in self.config.__dict__.keys() if k not in ['empty_init',])
31+
return ((k, self.get_service(k)) for k in self.config.__dict__.keys() if k not in ['empty_init', ])
3132

3233
def get_service(self, service, *args, **kwargs):
3334
service_object = import_from("pyms.flask.services.{}".format(service), "Service")

0 commit comments

Comments
 (0)