cadwyn 5.1.0__py3-none-any.whl → 5.1.1__py3-none-any.whl
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.
Potentially problematic release.
This version of cadwyn might be problematic. Click here for more details.
- cadwyn/schema_generation.py +13 -3
- {cadwyn-5.1.0.dist-info → cadwyn-5.1.1.dist-info}/METADATA +1 -1
- {cadwyn-5.1.0.dist-info → cadwyn-5.1.1.dist-info}/RECORD +6 -6
- {cadwyn-5.1.0.dist-info → cadwyn-5.1.1.dist-info}/WHEEL +0 -0
- {cadwyn-5.1.0.dist-info → cadwyn-5.1.1.dist-info}/entry_points.txt +0 -0
- {cadwyn-5.1.0.dist-info → cadwyn-5.1.1.dist-info}/licenses/LICENSE +0 -0
cadwyn/schema_generation.py
CHANGED
|
@@ -264,10 +264,20 @@ def _wrap_pydantic_model(model: type[_T_PYDANTIC_MODEL]) -> "_PydanticModelWrapp
|
|
|
264
264
|
|
|
265
265
|
wrapped_validator = _wrap_validator(decorator_wrapper.func, decorator_wrapper.shim, decorator_wrapper.info)
|
|
266
266
|
validators[decorator_wrapper.cls_var_name] = wrapped_validator
|
|
267
|
+
|
|
268
|
+
def _rebuild_annotated(name: str):
|
|
269
|
+
if field_info := model.model_fields.get(name):
|
|
270
|
+
if not field_info.metadata:
|
|
271
|
+
return field_info.annotation
|
|
272
|
+
|
|
273
|
+
if sys.version_info >= (3, 13):
|
|
274
|
+
return Annotated.__getitem__((field_info.annotation, *field_info.metadata)) # pyright: ignore[reportAttributeAccessIssue]
|
|
275
|
+
else:
|
|
276
|
+
return Annotated.__class_getitem__((field_info.annotation, *field_info.metadata)) # pyright: ignore[reportAttributeAccessIssue]
|
|
277
|
+
return model.__annotations__[name] # pragma: no cover
|
|
278
|
+
|
|
267
279
|
annotations = {
|
|
268
|
-
name: value
|
|
269
|
-
if not isinstance(value, str)
|
|
270
|
-
else model.model_fields[name].annotation or model.__annotations__[name]
|
|
280
|
+
name: value if not isinstance(value, str) else _rebuild_annotated(name)
|
|
271
281
|
for name, value in model.__annotations__.items()
|
|
272
282
|
}
|
|
273
283
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cadwyn
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.1
|
|
4
4
|
Summary: Production-ready community-driven modern Stripe-like API versioning in FastAPI
|
|
5
5
|
Project-URL: Source code, https://github.com/zmievsa/cadwyn
|
|
6
6
|
Project-URL: Documentation, https://docs.cadwyn.dev
|
|
@@ -11,7 +11,7 @@ cadwyn/middleware.py,sha256=jtcysj66Fck_3EteK0zLJCOTMms3g6avi3U8lV-roQI,4316
|
|
|
11
11
|
cadwyn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
cadwyn/route_generation.py,sha256=e7mnVqtvTx1Oh_khmrM0dAowhVUOO1K4vaVVEGgXgrY,25230
|
|
13
13
|
cadwyn/routing.py,sha256=EkV38cDQFAtR1M_fGWeq81lYaSPuDK4Pr8fjTTJVZvY,6912
|
|
14
|
-
cadwyn/schema_generation.py,sha256=
|
|
14
|
+
cadwyn/schema_generation.py,sha256=cKDIb1017JFrHNYla6CjUKC6u2rGg7Sw86paXRkh8Sk,45445
|
|
15
15
|
cadwyn/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
cadwyn/static/docs.html,sha256=WNm5ANJVy51TcIUFOaqKf1Z8eF86CC85TTHPxACtkzw,3455
|
|
17
17
|
cadwyn/structure/__init__.py,sha256=Wgvjdq3vfl9Yhe-BkcFGAMi_Co11YOfTmJQqgF5Gzx4,655
|
|
@@ -21,8 +21,8 @@ cadwyn/structure/endpoints.py,sha256=zUgzglNhBPnmWdJ03A8pFT4zPs_lj8nQ7c7Uo2d-ejU
|
|
|
21
21
|
cadwyn/structure/enums.py,sha256=4FCc9aniLE3VuWAVIacrNP_FWxTIUm9JkeeHA_zZdwQ,1254
|
|
22
22
|
cadwyn/structure/schemas.py,sha256=80AUbko1cksXh7qPBmnknDFLK52xr4kw9HfHeXqcw1I,10813
|
|
23
23
|
cadwyn/structure/versions.py,sha256=9ihqt27upAOWXCGYou2rCJ7ZqgxjJshKOFpx2LuLpBE,33905
|
|
24
|
-
cadwyn-5.1.
|
|
25
|
-
cadwyn-5.1.
|
|
26
|
-
cadwyn-5.1.
|
|
27
|
-
cadwyn-5.1.
|
|
28
|
-
cadwyn-5.1.
|
|
24
|
+
cadwyn-5.1.1.dist-info/METADATA,sha256=2FaGe5yf2bOMW3MizNMNWB3h2k79b-Zl8UeK_TkPYSo,4562
|
|
25
|
+
cadwyn-5.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
cadwyn-5.1.1.dist-info/entry_points.txt,sha256=mGX8wl-Xfhpr5M93SUmkykaqinUaYAvW9rtDSX54gx0,47
|
|
27
|
+
cadwyn-5.1.1.dist-info/licenses/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
28
|
+
cadwyn-5.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|