first commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# app/middlewares/request_validator.py
|
||||
from flask import request
|
||||
from app.helpers.response_helper import ResponseHelper
|
||||
|
||||
def validate_json():
|
||||
"""Ensure request has valid JSON"""
|
||||
if not request.is_json:
|
||||
return ResponseHelper.error(
|
||||
message="Request must be JSON",
|
||||
status_code=415
|
||||
)
|
||||
Reference in New Issue
Block a user