Added a decorator that can be applied to views to prevent swagger errors during schema generation.
Certain views rely on logged-in users and/or actual kwargs being passed to the views; those aren't provided during swagger schema generation and so errors will occur.
Added a decorator that can be applied to views to prevent swagger errors during schema generation.
Certain views rely on logged-in users and/or actual kwargs being passed to the views; those aren't provided during swagger schema generation and so errors will occur.
There is already code in several apps to stop further processing in those views (as per https://github.com/axnsan12/drf-yasg/issues/333#issuecomment-474883875). But doing it via a central decorator will remove loads of code duplication.