aiohttp_validate icon indicating copy to clipboard operation
aiohttp_validate copied to clipboard

How i can return custom response status?

Open alvassin opened this issue 6 years ago • 4 comments

How is it possible to return 201 status for example?

alvassin avatar Mar 12 '19 05:03 alvassin

Are you sure that the problem is with library? I think normal aiohttp way should work just fine. What you've tried already?

dchaplinsky avatar Mar 12 '19 06:03 dchaplinsky

Normally, i return Response with some body, custom headers, custom status.

With aiohttp-validate decorator i have to return directly only body. There is no way to define http status or headers. See: https://github.com/dchaplinsky/aiohttp_validate/blob/master/aiohttp_validate/init.py#L138

alvassin avatar Mar 12 '19 08:03 alvassin

Yes, you are right. Well, cannot say I have too much time on this project now. Happy to review PR as long as it'll keep backward compatibility.

dchaplinsky avatar Mar 12 '19 08:03 dchaplinsky

Okay, asked just in case if you have workaround :)

alvassin avatar Mar 12 '19 08:03 alvassin