fastapi-voyager 0.11.9__tar.gz → 0.11.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/PKG-INFO +3 -1
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/README.md +2 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/type_helper.py +6 -9
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/version.py +1 -1
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/demo.py +6 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/.github/workflows/publish.yml +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/.gitignore +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/.python-version +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/LICENSE +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/pyproject.toml +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/release.md +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/__init__.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/cli.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/filter.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/module.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/render.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/server.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/type.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/voyager.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/component/render-graph.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/component/route-code-display.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/component/schema-code-display.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/component/schema-field-filter.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/graph-ui.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/graphviz.svg.css +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/graphviz.svg.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/android-chrome-192x192.png +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/android-chrome-512x512.png +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/apple-touch-icon.png +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/favicon-16x16.png +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/favicon-32x32.png +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/favicon.ico +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/site.webmanifest +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/index.html +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/quasar.min.css +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/quasar.min.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/vue-main.js +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/__init__.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/demo_anno.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/programatic.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/service/__init__.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/service/schema.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_analysis.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_filter.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_generic.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_import.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_module.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/tests/test_type_helper.py +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/uv.lock +0 -0
- {fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/voyager.jpg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.10
|
|
4
4
|
Summary: Visualize FastAPI application's routing tree and dependencies
|
|
5
5
|
Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
|
|
6
6
|
Project-URL: Source, https://github.com/allmonday/fastapi-voyager
|
|
@@ -277,6 +277,8 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
|
|
|
277
277
|
- [x] fix swagger link in another way
|
|
278
278
|
- 0.11.9
|
|
279
279
|
- [x] replace issubclass with safe_issubclass to prevent exception.
|
|
280
|
+
- 0.11.10
|
|
281
|
+
- [x] fix bug during updating forward refs
|
|
280
282
|
|
|
281
283
|
#### 0.12
|
|
282
284
|
- [ ] add tests
|
|
@@ -248,6 +248,8 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
|
|
|
248
248
|
- [x] fix swagger link in another way
|
|
249
249
|
- 0.11.9
|
|
250
250
|
- [x] replace issubclass with safe_issubclass to prevent exception.
|
|
251
|
+
- 0.11.10
|
|
252
|
+
- [x] fix bug during updating forward refs
|
|
251
253
|
|
|
252
254
|
#### 0.12
|
|
253
255
|
- [ ] add tests
|
|
@@ -232,27 +232,24 @@ def safe_issubclass(kls, classinfo):
|
|
|
232
232
|
try:
|
|
233
233
|
return issubclass(kls, classinfo)
|
|
234
234
|
except TypeError:
|
|
235
|
-
|
|
235
|
+
# may raise error for corner case such as ForwardRef
|
|
236
|
+
print(str(kls), 'is not a target class')
|
|
236
237
|
return False
|
|
237
238
|
|
|
238
239
|
|
|
239
240
|
def update_forward_refs(kls):
|
|
240
241
|
# TODO: refactor
|
|
241
|
-
def update_pydantic_forward_refs(
|
|
242
|
+
def update_pydantic_forward_refs(pydantic_kls: Type[BaseModel]):
|
|
242
243
|
"""
|
|
243
244
|
recursively update refs.
|
|
244
245
|
"""
|
|
245
246
|
|
|
246
|
-
|
|
247
|
-
setattr(
|
|
247
|
+
pydantic_kls.model_rebuild()
|
|
248
|
+
setattr(pydantic_kls, const.PYDANTIC_FORWARD_REF_UPDATED, True)
|
|
248
249
|
|
|
249
|
-
values =
|
|
250
|
+
values = pydantic_kls.model_fields.values()
|
|
250
251
|
for field in values:
|
|
251
252
|
update_forward_refs(field.annotation)
|
|
252
|
-
|
|
253
|
-
if safe_issubclass(kls, BaseModel):
|
|
254
|
-
kls.model_rebuild()
|
|
255
|
-
setattr(kls, const.PYDANTIC_FORWARD_REF_UPDATED, True)
|
|
256
253
|
|
|
257
254
|
for shelled_type in get_core_types(kls):
|
|
258
255
|
if getattr(shelled_type, const.PYDANTIC_FORWARD_REF_UPDATED, False):
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.11.
|
|
2
|
+
__version__ = "0.11.10"
|
|
@@ -4,6 +4,7 @@ from typing import Optional, Generic, TypeVar
|
|
|
4
4
|
from pydantic_resolve import ensure_subset, Resolver
|
|
5
5
|
from tests.service.schema import Story, Task, A
|
|
6
6
|
import tests.service.schema as serv
|
|
7
|
+
from dataclasses import dataclass
|
|
7
8
|
|
|
8
9
|
app = FastAPI(title="Demo API", description="A demo FastAPI application for router visualization")
|
|
9
10
|
|
|
@@ -15,6 +16,11 @@ class PageMember(serv.Member):
|
|
|
15
16
|
fullname: str = ''
|
|
16
17
|
def post_fullname(self):
|
|
17
18
|
return self.first_name + ' ' + self.last_name
|
|
19
|
+
sh: 'Something' # forward reference
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class Something:
|
|
23
|
+
id: int
|
|
18
24
|
|
|
19
25
|
class TaskA(Task):
|
|
20
26
|
task_type: str = 'A'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/component/render-graph.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/apple-touch-icon.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/favicon-16x16.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/favicon-32x32.png
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.11.9 → fastapi_voyager-0.11.10}/src/fastapi_voyager/web/icon/site.webmanifest
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|