cadwyn 4.2.0__py3-none-any.whl → 4.2.2__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/_asts.py +2 -2
- cadwyn/applications.py +11 -1
- cadwyn/schema_generation.py +2 -2
- cadwyn/structure/versions.py +1 -1
- {cadwyn-4.2.0.dist-info → cadwyn-4.2.2.dist-info}/METADATA +1 -1
- {cadwyn-4.2.0.dist-info → cadwyn-4.2.2.dist-info}/RECORD +9 -9
- {cadwyn-4.2.0.dist-info → cadwyn-4.2.2.dist-info}/LICENSE +0 -0
- {cadwyn-4.2.0.dist-info → cadwyn-4.2.2.dist-info}/WHEEL +0 -0
- {cadwyn-4.2.0.dist-info → cadwyn-4.2.2.dist-info}/entry_points.txt +0 -0
cadwyn/_asts.py
CHANGED
|
@@ -28,7 +28,7 @@ _BaseGenericAlias = cast(type, type(List[int])).mro()[1] # noqa: UP006
|
|
|
28
28
|
GenericAliasUnion = GenericAlias | _BaseGenericAlias
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def get_fancy_repr(value: Any):
|
|
31
|
+
def get_fancy_repr(value: Any) -> Any:
|
|
32
32
|
if isinstance(value, annotated_types.GroupedMetadata) and hasattr(type(value), "__dataclass_fields__"):
|
|
33
33
|
return transform_grouped_metadata(value)
|
|
34
34
|
if isinstance(value, list | tuple | set | frozenset):
|
|
@@ -85,7 +85,7 @@ def transform_generic_alias(value: GenericAliasUnion) -> Any:
|
|
|
85
85
|
return f"{get_fancy_repr(get_origin(value))}[{', '.join(get_fancy_repr(a) for a in get_args(value))}]"
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def transform_none(_:
|
|
88
|
+
def transform_none(_: type[None]) -> Any:
|
|
89
89
|
return "None"
|
|
90
90
|
|
|
91
91
|
|
cadwyn/applications.py
CHANGED
|
@@ -269,12 +269,20 @@ class Cadwyn(FastAPI):
|
|
|
269
269
|
else:
|
|
270
270
|
raise not_found_error
|
|
271
271
|
|
|
272
|
+
# Add root path to servers when mounted as sub-app or proxy is used
|
|
273
|
+
urls = (server_data.get("url") for server_data in self.servers)
|
|
274
|
+
server_urls = {url for url in urls if url}
|
|
275
|
+
root_path = self._extract_root_path(req)
|
|
276
|
+
if root_path and root_path not in server_urls and self.root_path_in_servers:
|
|
277
|
+
self.servers.insert(0, {"url": root_path})
|
|
278
|
+
|
|
272
279
|
return JSONResponse(
|
|
273
280
|
get_openapi(
|
|
274
281
|
title=self.title,
|
|
275
282
|
version=formatted_version,
|
|
276
283
|
openapi_version=self.openapi_version,
|
|
277
284
|
description=self.description,
|
|
285
|
+
summary=self.summary,
|
|
278
286
|
terms_of_service=self.terms_of_service,
|
|
279
287
|
contact=self.contact,
|
|
280
288
|
license_info=self.license_info,
|
|
@@ -319,7 +327,9 @@ class Cadwyn(FastAPI):
|
|
|
319
327
|
return req.scope.get("root_path", "").rstrip("/")
|
|
320
328
|
|
|
321
329
|
def _render_docs_dashboard(self, req: Request, docs_url: str):
|
|
322
|
-
|
|
330
|
+
base_host = str(req.base_url).rstrip("/")
|
|
331
|
+
root_path = self._extract_root_path(req)
|
|
332
|
+
base_url = base_host + root_path
|
|
323
333
|
table = {version: f"{base_url}{docs_url}?version={version}" for version in self.router.sorted_versions}
|
|
324
334
|
if self._there_are_public_unversioned_routes():
|
|
325
335
|
table |= {"unversioned": f"{base_url}{docs_url}?version=unversioned"}
|
cadwyn/schema_generation.py
CHANGED
|
@@ -341,12 +341,12 @@ class _PydanticModelWrapper(Generic[_T_PYDANTIC_MODEL]):
|
|
|
341
341
|
per_field_validators = {
|
|
342
342
|
name: validator.decorator(*validator.fields, **validator.kwargs)(validator.func)
|
|
343
343
|
for name, validator in self.validators.items()
|
|
344
|
-
if not validator.is_deleted and type(validator) == _PerFieldValidatorWrapper
|
|
344
|
+
if not validator.is_deleted and type(validator) == _PerFieldValidatorWrapper # noqa: E721
|
|
345
345
|
}
|
|
346
346
|
root_validators = {
|
|
347
347
|
name: validator.decorator(**validator.kwargs)(validator.func)
|
|
348
348
|
for name, validator in self.validators.items()
|
|
349
|
-
if not validator.is_deleted and type(validator) == _ValidatorWrapper
|
|
349
|
+
if not validator.is_deleted and type(validator) == _ValidatorWrapper # noqa: E721
|
|
350
350
|
}
|
|
351
351
|
fields = {name: field.generate_field_copy(generator) for name, field in self.fields.items()}
|
|
352
352
|
model_copy = type(self.cls)(
|
cadwyn/structure/versions.py
CHANGED
|
@@ -479,7 +479,7 @@ class VersionBundle:
|
|
|
479
479
|
if response_param_name == _CADWYN_RESPONSE_PARAM_NAME:
|
|
480
480
|
_add_keyword_only_parameter(decorator, _CADWYN_RESPONSE_PARAM_NAME, FastapiResponse)
|
|
481
481
|
|
|
482
|
-
return decorator
|
|
482
|
+
return decorator # pyright: ignore[reportReturnType]
|
|
483
483
|
|
|
484
484
|
return wrapper
|
|
485
485
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
cadwyn/__init__.py,sha256=w4Iu8rEu9zfptMKsBaWgAj0vJABKGJukKYQBNbuwt1Q,1035
|
|
2
2
|
cadwyn/__main__.py,sha256=fGoKJPNVueqqXW4rqwmRUBBMoDGeLEyATdT-rel5Pvs,2449
|
|
3
|
-
cadwyn/_asts.py,sha256=
|
|
3
|
+
cadwyn/_asts.py,sha256=OVOPjjZNrPHpbicf4Gg5HmWToPOdMo8S56pKDDJATRY,5139
|
|
4
4
|
cadwyn/_importer.py,sha256=2mZrDHlfY2heZsMBW-9RBpvKsCk9I-Wa8pxZ6f2f8gY,1074
|
|
5
5
|
cadwyn/_render.py,sha256=LJ-R1TrBgMJpTkJb6pQdRWaMjKyw3R6eTlXXEieqUw0,5466
|
|
6
6
|
cadwyn/_utils.py,sha256=GK9w_qzyOI_o6UaGVfwLLYhnJFMzXistoYI9fq2E9dE,1159
|
|
7
|
-
cadwyn/applications.py,sha256=
|
|
7
|
+
cadwyn/applications.py,sha256=9gObB244eDTMi9-Nah3F5ErB2bSABkeGHWO7lfBcivM,16013
|
|
8
8
|
cadwyn/changelogs.py,sha256=SdrdAKQ01mpzs-EN_zg-D0TY7wxsibjRjLMhGcI4q80,20066
|
|
9
9
|
cadwyn/exceptions.py,sha256=VlJKRmEGfFTDtHbOWc8kXK4yMi2N172K684Y2UIV8rI,1832
|
|
10
10
|
cadwyn/middleware.py,sha256=8cuBri_yRkl0goe6G0MLwtL04WGbW9Infah3wy9hUVM,3372
|
|
11
11
|
cadwyn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
cadwyn/route_generation.py,sha256=-4HJWH2AoyGuB4qER-Gjc6kgUYUpzo_FoSkw3Gyi6rU,22872
|
|
13
13
|
cadwyn/routing.py,sha256=9AHSojmuLgUAQlLMIqXz-ViZ9n-fljgOsn7oxha7PjM,7341
|
|
14
|
-
cadwyn/schema_generation.py,sha256=
|
|
14
|
+
cadwyn/schema_generation.py,sha256=DPNQe8sYRc6MEiRzhrsalbhc-rveK-YQZ4B-C0hJJ4E,39995
|
|
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=vej7TdTMSOg8U8Wk7GTNdA4rc6loA9083FWaTg4jAaY,655
|
|
@@ -20,9 +20,9 @@ cadwyn/structure/data.py,sha256=1ALPhBBCE_t4GrxM0Fa3hQ-jkORJgeWNySnZ42bsi0g,7382
|
|
|
20
20
|
cadwyn/structure/endpoints.py,sha256=9FFnbqPM9v0CP6J6tGhMNKVvWqA9u3ZjI2Fannr2Rl0,5933
|
|
21
21
|
cadwyn/structure/enums.py,sha256=bZL-iUOUFi9ZYlMZJw-tAix2yrgCp3gH3N2gwO44LUU,1043
|
|
22
22
|
cadwyn/structure/schemas.py,sha256=D0BD1D3v9MRdVWchU9JM2zHd0dvB0UgXHDGFCe5aQZc,8209
|
|
23
|
-
cadwyn/structure/versions.py,sha256=
|
|
24
|
-
cadwyn-4.2.
|
|
25
|
-
cadwyn-4.2.
|
|
26
|
-
cadwyn-4.2.
|
|
27
|
-
cadwyn-4.2.
|
|
28
|
-
cadwyn-4.2.
|
|
23
|
+
cadwyn/structure/versions.py,sha256=olhHdJqzTZMTH3BKB_ot5pTaeckSFoiG07ADkPzEs1Y,32570
|
|
24
|
+
cadwyn-4.2.2.dist-info/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
25
|
+
cadwyn-4.2.2.dist-info/METADATA,sha256=saG3847i_3Q_gLd7ykwRFxyflDsMzqqzlgg97_qYXdU,4420
|
|
26
|
+
cadwyn-4.2.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
27
|
+
cadwyn-4.2.2.dist-info/entry_points.txt,sha256=eO05hLn9GoRzzpwT9GONPmXKsonjuMNssM2D2WHWKGk,46
|
|
28
|
+
cadwyn-4.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|