This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import is_dataclass | |
from datetime import datetime | |
from decimal import Decimal | |
from typing import Optional, Union, get_args, get_origin, get_type_hints | |
from flask import current_app, json | |
JSONType = None | type | dict | list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
from flask import Blueprint, request, redirect, url_for | |
from flask_jsontools import jsonapi | |
def ensure_json_request(f): | |
@wraps(f) | |
def enforce_json_body(*args, **kwargs): | |
if not request.is_json: |