You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a method is passed as an endpoint and we try to add is_routed to it, an attribute error is raised and it's passed it silently, So the route.is_function fails and that's what caused schemas to fail since the endpoint is a mehtod API.schema_response.
UPDATE
One of the solutions :
@property
def is_function(self):
# We can also remove is_routed ?
routed = hasattr(self.endpoint, "is_routed") or callable(self.endpoint)
code = hasattr(self.endpoint, "__code__")
kwdefaults = hasattr(self.endpoint, "__kwdefaults__")
return all((routed, code, kwdefaults))
or :
try:
if callable(endpoint):
endpoint.__dict__["is_routed"] = True
except TypeError:
pass
When a method is passed as an endpoint and we try to add
is_routed
to it, an attribute error is raised and it's passed it silently, So theroute.is_function
fails and that's what caused schemas to fail since the endpoint is a mehtodAPI.schema_response
.UPDATE
One of the solutions :
or :
@kennethreitz What solution you prefer ?
The text was updated successfully, but these errors were encountered: