Deprecate aiohttp 1 support
@@ -25,13 +25,21 @@ Example: ::
"""
import asyncio
import json
+import warnings
+import aiohttp
from aiohttp import web
from aiohttp import web_exceptions
from webargs import core
from webargs.async import AsyncParser
+AIOHTTP_MAJOR_VERSION = int(aiohttp.__version__.split('.')[0])
+if AIOHTTP_MAJOR_VERSION < 2:
+ warnings.warn(
+ 'Support for aiohttp<2.0.0 is deprecated and is removed in webargs 2.0.0',
+ DeprecationWarning
+ )
def is_json_request(req):
content_type = req.content_type
