34 """Set response model for the endpoint.
37 model: Pydantic model class or None to disable response model.
42 def decorator(func: Callable) -> Callable:
44 def wrapper(*args, **kwargs):
45 return func(*args, **kwargs)
47 setattr(wrapper,
"_response_model", model)
50 if hasattr(func,
'_requires_auth'):
51 setattr(wrapper,
"_requires_auth", getattr(func,
"_requires_auth"))
52 if hasattr(func,
'_requires_admin'):
53 setattr(wrapper,
"_requires_admin",
54 getattr(func,
"_requires_admin"))
55 if hasattr(func,
'_public'):
56 setattr(wrapper,
"_public", getattr(func,
"_public"))
57 if hasattr(func,
'_security_level'):
58 setattr(wrapper,
"_security_level",
59 getattr(func,
"_security_level"))
60 if hasattr(func,
'_tags'):
61 setattr(wrapper,
"_tags", getattr(func,
"_tags"))
62 if hasattr(func,
'_description'):
63 setattr(wrapper,
"_description", getattr(func,
"_description"))
64 if hasattr(func,
'_summary'):
65 setattr(wrapper,
"_summary", getattr(func,
"_summary"))