Skip to content

Commit 8776633

Browse files
committed
Fixed schema and Sanic.test_mode
1 parent ffd59db commit 8776633

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fastopenapi/core/router.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def add_route(self, path: str, method: str, endpoint: Callable):
8484
meta = getattr(endpoint, "__route_meta__", {})
8585
route = RouteInfo(path, method, endpoint, meta)
8686
self._routes.append(route)
87+
self._openapi_schema = None
8788

8889
def include_router(self, other: "BaseRouter", prefix: str = ""):
8990
"""Include routes from another router"""

tests/routers/sanic/test_sanic_router.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
from fastopenapi.routers import SanicRouter
55

6+
Sanic.test_mode = True
7+
68

79
class TestSanicRouter:
810
def test_router_initialization(self):

0 commit comments

Comments
 (0)