jararaca 0.3.12a1__py3-none-any.whl → 0.3.12a2__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.

@@ -603,8 +603,19 @@ class HttpParemeterSpec:
603
603
 
604
604
 
605
605
  def parse_path_with_params(path: str, parameters: list[HttpParemeterSpec]) -> str:
606
+ # Use a regular expression to match both simple parameters {param} and
607
+ # parameters with converters {param:converter}
608
+ import re
609
+
610
+ pattern = re.compile(r"{([^:}]+)(?::[^}]*)?}")
611
+
612
+ # For each parameter found in the path, replace it with :param format
606
613
  for parameter in parameters:
607
- path = path.replace(f"{{{parameter.name}}}", f":{parameter.name}")
614
+ path = pattern.sub(
615
+ lambda m: f":{m.group(1)}" if m.group(1) == parameter.name else m.group(0),
616
+ path,
617
+ )
618
+
608
619
  return path
609
620
 
610
621
 
@@ -728,7 +739,9 @@ def extract_parameters(
728
739
  )
729
740
  mapped_types.update(rec_mapped_types)
730
741
  parameters_list.extend(rec_parameters)
731
- elif controller.path.find(f":{parameter_name}") != -1:
742
+ elif (
743
+ re.search(f":{parameter_name}(?:/|$)", controller.path) is not None
744
+ ):
732
745
  mapped_types.add(annotated_type)
733
746
  parameters_list.append(
734
747
  HttpParemeterSpec(
@@ -762,8 +775,9 @@ def extract_parameters(
762
775
  )
763
776
  )
764
777
  elif (
765
- controller.path.find(f"{{{parameter_name}}}") != -1
766
- or mapping.path.find(f"{{{parameter_name}}}") != -1
778
+ # Match both simple parameters {param} and parameters with converters {param:converter}
779
+ re.search(f"{{{parameter_name}(:.*?)?}}", controller.path) is not None
780
+ or re.search(f"{{{parameter_name}(:.*?)?}}", mapping.path) is not None
767
781
  ):
768
782
  mapped_types.add(parameter_type)
769
783
  parameters_list.append(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jararaca
3
- Version: 0.3.12a1
3
+ Version: 0.3.12a2
4
4
  Summary: A simple and fast API framework for Python
5
5
  Home-page: https://github.com/LuscasLeo/jararaca
6
6
  Author: Lucas S
@@ -1,6 +1,6 @@
1
1
  LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
2
2
  README.md,sha256=2qMM__t_MoLKZr4IY9tXjo-Jn6LKjuHMb1qbyXpgL08,3401
3
- pyproject.toml,sha256=pegG6HUFXIUVHdfGGruJu_hqjwWTYYSSsRar1mjbmqw,2040
3
+ pyproject.toml,sha256=Fe73Scr1Mki0Kbnzu6Oyb2Xm3oavGZOoI0-KDTcpRuk,2040
4
4
  jararaca/__init__.py,sha256=EdOPigKYraoG7I-Hl9V3XteqrbhdBS3xy1rUakh58lc,17949
5
5
  jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
6
6
  jararaca/broker_backend/__init__.py,sha256=GzEIuHR1xzgCJD4FE3harNjoaYzxHMHoEL0_clUaC-k,3528
@@ -66,12 +66,12 @@ jararaca/scheduler/types.py,sha256=4HEQOmVIDp-BYLSzqmqSFIio1bd51WFmgFPIzPpVu04,1
66
66
  jararaca/tools/app_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaNXMp8fd1Ndk,941
68
68
  jararaca/tools/app_config/interceptor.py,sha256=HV8h4AxqUc_ACs5do4BSVlyxlRXzx7HqJtoVO9tfRnQ,2611
69
- jararaca/tools/typescript/interface_parser.py,sha256=rM2t_6iAC2u75vBvTmZYy-JS14w36s4PKmaaGZzRYw4,30944
69
+ jararaca/tools/typescript/interface_parser.py,sha256=Bux7DUjEQ8eAry_qZeKCIYz0aPaMO78_5wAPVErXGFo,31482
70
70
  jararaca/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  jararaca/utils/rabbitmq_utils.py,sha256=ytdAFUyv-OBkaVnxezuJaJoLrmN7giZgtKeet_IsMBs,10918
72
72
  jararaca/utils/retry.py,sha256=DzPX_fXUvTqej6BQ8Mt2dvLo9nNlTBm7Kx2pFZ26P2Q,4668
73
- jararaca-0.3.12a1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
74
- jararaca-0.3.12a1.dist-info/METADATA,sha256=vwoe5SBCrXlu3jg5CE_pBXADBbTnKipjeLBAN7S71DI,4995
75
- jararaca-0.3.12a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
76
- jararaca-0.3.12a1.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
77
- jararaca-0.3.12a1.dist-info/RECORD,,
73
+ jararaca-0.3.12a2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
74
+ jararaca-0.3.12a2.dist-info/METADATA,sha256=Ncw0QFO1rWFflZVAjPE79Eja9A_wBrqCSEsPrFr2fmQ,4995
75
+ jararaca-0.3.12a2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
76
+ jararaca-0.3.12a2.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
77
+ jararaca-0.3.12a2.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "jararaca"
3
- version = "0.3.12a1"
3
+ version = "0.3.12a2"
4
4
  description = "A simple and fast API framework for Python"
5
5
  authors = ["Lucas S <me@luscasleo.dev>"]
6
6
  readme = "README.md"