After some tests, I found out that adding the include_extras parameter when inferring the types, would lead to annotations being carried over to request validation. This leads to this working:
from aiohttp.web import json_response, Application, run_app
from pydantic import Base64UrlStr, SerializeAsAny
from aiohttp_pydantic import PydanticView
class MyView(PydanticView):
async def get(self, search: SerializeAsAny[Base64UrlStr], /):
return json_response({"search": search})
if __name__ == '__main__':
app = Application()
app.router.add_view('/{search}', MyView)
run_app(app)
After some tests, I found out that adding the
include_extras
parameter when inferring the types, would lead to annotations being carried over to request validation. This leads to this working:So base64 decoding implicitly via the type. That is awesome. But I am not 100% sure about problems with that. Tests are running through.
P.S.: Thx for the good work, the project is really enhancing the work with my aiohttp-servers.