Skip to content

Commit 3b7d16a

Browse files
chore: add ai tests
Signed-off-by: Charan Kamarapu <kamarapucharan@gmail.com>
1 parent b9b12b5 commit 3b7d16a

286 files changed

Lines changed: 105790 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apigateway/app.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,40 @@ def gw_login():
6060

6161
@app.route('/api/v1/users', methods=['GET', 'POST'])
6262
def gw_users_root():
63-
return _proxy(USER_SERVICE_URL)
63+
# Forward to /api/v1/users on the user-service
64+
return _proxy(USER_SERVICE_URL, 'users')
6465

6566

6667
@app.route('/api/v1/users/<path:subpath>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
6768
def gw_users(subpath):
68-
return _proxy(USER_SERVICE_URL, subpath)
69+
# Always include the users/ prefix when forwarding
70+
return _proxy(USER_SERVICE_URL, f"users/{subpath}")
6971

7072

7173
# Products
7274
@app.route('/api/v1/products', methods=['GET', 'POST'])
7375
def gw_products_root():
74-
return _proxy(PRODUCT_SERVICE_URL)
76+
# Forward to /api/v1/products on the product-service
77+
return _proxy(PRODUCT_SERVICE_URL, 'products')
7578

7679

7780
@app.route('/api/v1/products/<path:subpath>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
7881
def gw_products(subpath):
79-
return _proxy(PRODUCT_SERVICE_URL, subpath)
82+
# Always include the products/ prefix when forwarding
83+
return _proxy(PRODUCT_SERVICE_URL, f"products/{subpath}")
8084

8185

8286
# Orders
8387
@app.route('/api/v1/orders', methods=['GET', 'POST'])
8488
def gw_orders_root():
85-
return _proxy(ORDER_SERVICE_URL)
89+
# Forward to /api/v1/orders on the order-service
90+
return _proxy(ORDER_SERVICE_URL, 'orders')
8691

8792

8893
@app.route('/api/v1/orders/<path:subpath>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
8994
def gw_orders(subpath):
90-
return _proxy(ORDER_SERVICE_URL, subpath)
95+
# Always include the orders/ prefix when forwarding
96+
return _proxy(ORDER_SERVICE_URL, f"orders/{subpath}")
9197

9298

9399
@app.route('/health', methods=['GET'])

apigateway/openapi.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,21 @@ paths:
288288
content:
289289
application/json:
290290
schema: { $ref: '#/components/schemas/Error' }
291+
delete:
292+
tags: [Users]
293+
summary: Delete user
294+
parameters:
295+
- in: path
296+
name: userId
297+
required: true
298+
schema: { type: string }
299+
responses:
300+
'200': { description: Deleted }
301+
'404':
302+
description: Not found
303+
content:
304+
application/json:
305+
schema: { $ref: '#/components/schemas/Error' }
291306

292307
/api/v1/users/{userId}/addresses:
293308
get:

0 commit comments

Comments
 (0)