jararaca 0.2.28__py3-none-any.whl → 0.2.30__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 jararaca might be problematic. Click here for more details.
- jararaca/persistence/sort_filter.py +2 -0
- jararaca/tools/typescript/interface_parser.py +11 -1
- {jararaca-0.2.28.dist-info → jararaca-0.2.30.dist-info}/METADATA +1 -1
- {jararaca-0.2.28.dist-info → jararaca-0.2.30.dist-info}/RECORD +8 -8
- pyproject.toml +1 -1
- {jararaca-0.2.28.dist-info → jararaca-0.2.30.dist-info}/LICENSE +0 -0
- {jararaca-0.2.28.dist-info → jararaca-0.2.30.dist-info}/WHEEL +0 -0
- {jararaca-0.2.28.dist-info → jararaca-0.2.30.dist-info}/entry_points.txt +0 -0
|
@@ -103,6 +103,8 @@ class SortFilterRunner:
|
|
|
103
103
|
__value = (
|
|
104
104
|
filter.value[0] if isinstance(filter.value, list) else filter.value
|
|
105
105
|
)
|
|
106
|
+
if not __value.strip():
|
|
107
|
+
return query
|
|
106
108
|
if field_type is date:
|
|
107
109
|
value = datetime.strptime(__value, "%Y-%m-%d").date()
|
|
108
110
|
else:
|
|
@@ -27,6 +27,7 @@ from fastapi import Request, Response, UploadFile
|
|
|
27
27
|
from fastapi.params import Body, Cookie, Depends, Header, Path, Query
|
|
28
28
|
from fastapi.security.http import HTTPBase
|
|
29
29
|
from pydantic import BaseModel, PlainValidator
|
|
30
|
+
from pydantic_core import PydanticUndefinedType
|
|
30
31
|
|
|
31
32
|
from jararaca.microservice import Microservice
|
|
32
33
|
from jararaca.presentation.decorators import HttpMapping, RestController
|
|
@@ -259,8 +260,17 @@ def parse_type_to_typescript_interface(
|
|
|
259
260
|
for field_name, field in basemodel_type.__annotations__.items():
|
|
260
261
|
if field_name in cls_consts:
|
|
261
262
|
continue
|
|
263
|
+
|
|
264
|
+
has_default_value = (
|
|
265
|
+
get_origin(field) is not Literal
|
|
266
|
+
and field_name in basemodel_type.model_fields
|
|
267
|
+
and not isinstance(
|
|
268
|
+
basemodel_type.model_fields[field_name].default,
|
|
269
|
+
PydanticUndefinedType,
|
|
270
|
+
)
|
|
271
|
+
)
|
|
262
272
|
string_builder.write(
|
|
263
|
-
f" {snake_to_camel(field_name) if not is_constant(field_name) else field_name}: {get_field_type_for_ts(field)};\n"
|
|
273
|
+
f" {snake_to_camel(field_name) if not is_constant(field_name) else field_name}{'?' if has_default_value else ''}: {get_field_type_for_ts(field)};\n"
|
|
264
274
|
)
|
|
265
275
|
mapped_types.update(extract_all_envolved_types(field))
|
|
266
276
|
mapped_types.add(field)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
README.md,sha256=mte30I-ZEJJp-Oax-OganNgl6G9GaCZPL6JVFAvZGz4,7034
|
|
3
|
-
pyproject.toml,sha256=
|
|
3
|
+
pyproject.toml,sha256=jg_VLUKQyKK8Ba42cQRoLxIyDEWNv9jX-phrd3VTlRQ,1837
|
|
4
4
|
jararaca/__init__.py,sha256=h1lYQMmB8TATPG0GXjIzLZWHbWFhvkAFu-yBjm2W18g,13875
|
|
5
5
|
jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
|
|
6
6
|
jararaca/cli.py,sha256=fh7lp7rf5xbV5VaoSYWWehktel6BPcOXMjW7cw4wKms,5693
|
|
@@ -28,7 +28,7 @@ jararaca/persistence/exports.py,sha256=Ghx4yoFaB4QVTb9WxrFYgmcSATXMNvrOvT8ybPNKX
|
|
|
28
28
|
jararaca/persistence/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=H6ZjOdosYGCZUzKjugiXQwJkAbnsL4HnkZLOEQhULEc,1986
|
|
30
30
|
jararaca/persistence/session.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
jararaca/persistence/sort_filter.py,sha256=
|
|
31
|
+
jararaca/persistence/sort_filter.py,sha256=ZEr49HixsL2nspmM5yr-BJtxJhO1m2oKe5tsZ3_NsNs,6873
|
|
32
32
|
jararaca/persistence/utilities.py,sha256=fDJlX7CHnpMmZYrp4GcoAqwqzpIfPkyaFB8ei1Ey-MA,11858
|
|
33
33
|
jararaca/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
jararaca/presentation/decorators.py,sha256=eL2YCgMSr19m4YCri5PQU46NRxf0QxsqDnz6MqKu0YQ,8389
|
|
@@ -57,9 +57,9 @@ jararaca/tools/app_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
57
57
|
jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaNXMp8fd1Ndk,941
|
|
58
58
|
jararaca/tools/app_config/interceptor.py,sha256=nfFZiS80hrbnL7-XEYrwmp2rwaVYBqxvqu3Y-6o_ov4,2575
|
|
59
59
|
jararaca/tools/metadata.py,sha256=7nlCDYgItNybentPSSCc2MLqN7IpBd0VyQzfjfQycVI,1402
|
|
60
|
-
jararaca/tools/typescript/interface_parser.py,sha256=
|
|
61
|
-
jararaca-0.2.
|
|
62
|
-
jararaca-0.2.
|
|
63
|
-
jararaca-0.2.
|
|
64
|
-
jararaca-0.2.
|
|
65
|
-
jararaca-0.2.
|
|
60
|
+
jararaca/tools/typescript/interface_parser.py,sha256=_dPBRKs_67eiQ8cPWp8q1uGbIPxZ30dypfoqhbBAL_Y,28790
|
|
61
|
+
jararaca-0.2.30.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
62
|
+
jararaca-0.2.30.dist-info/METADATA,sha256=O786Yf1cKDPBRKnnSypU2hlYoOon2E5Xeg2kdYUaVK8,8552
|
|
63
|
+
jararaca-0.2.30.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
64
|
+
jararaca-0.2.30.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
|
|
65
|
+
jararaca-0.2.30.dist-info/RECORD,,
|
pyproject.toml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|