Closed Alc-Alc closed 1 year ago
Looking at https://github.com/starlite-api/starlite/blob/main/starlite/router.py#L287, the isinstance
check seems to only check for Router
and not for handlers.http.get
?
if isinstance(value, Router):
if value.owner:
raise ImproperlyConfiguredException(f"Router with path {value.path} has already been registered")
Ok, so looking at this- its actually not a bug: https://starlite-api.github.io/starlite/usage/1-routing/4-registering-components-multiple-times/#dynamic-route-registration, closing this.
Hello,
Can anyone tell me white this(starlite instance route register) was called twice, It creates a bug with Router because of
if isinstance(value, Router):
if value.owner:
raise ImproperlyConfiguredException(f"Router with path {value.path} has already been registered")
Describe the bug Adding a previously attached route using
app.register
should not be allowed.starlite.exceptions.http_exceptions.ImproperlyConfiguredException
should be raised.To Reproduce
Additional context Both the routes
/v1/foo
and/foo
are accessible.