From 80bb99c6e67335c6d1a1b08da533f05f9f0df558 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Tue, 30 Jan 2024 11:41:34 +0100 Subject: [PATCH] Fix namespace configuration. --- api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api.py b/api.py index 6947410..cb8c7cf 100644 --- a/api.py +++ b/api.py @@ -53,8 +53,8 @@ db = SQLAlchemy(app) api = Api(app, version='1.0', title='Store metrics in DB', description='API to record and access metrics.', authorizations=authorizations) -ns = api.namespace('/stock', description='Stock API') -ns = api.namespace('/electricity', description='Electricity API') +ns_stock = api.namespace('stock/', description='Stock API') +ns_electricity = api.namespace('electricity/', description='Electricity API') class Stock(db.Model): __tablename__ = "Stock" @@ -128,7 +128,8 @@ class Search_stocks(Resource): logging.debug(result) return result -api.add_namespace(ns) +api.add_namespace(ns_stock) +api.add_namespace(ns_electricity) db.create_all() migrate = Migrate(app, db, compare_type=True)