api-foundry 0.8.7__tar.gz → 0.8.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: api-foundry
3
- Version: 0.8.7
3
+ Version: 0.8.9
4
4
  Summary: The `api_foundry` project is a powerful tool designed to automate the deployment of REST APIs on AWS using Lambda services to access and interact with relational databases (RDBMS). This project leverages the OpenAPI specification to define and manage the APIs
5
5
  Project-URL: Documentation, https://github.com/DanRepik/api-foundry
6
6
  Project-URL: Source, https://github.com/DanRepik/api-foundry
@@ -1,5 +1,5 @@
1
1
  # __init__.py
2
- __version__ = "0.8.7"
2
+ __version__ = "0.8.9"
3
3
 
4
4
  from api_foundry.iac.pulumi.api_foundry import APIFoundry
5
5
  from cloud_foundry import logger
@@ -177,6 +177,7 @@ class APISpecEditor:
177
177
 
178
178
  def generate_regex(self, property: dict[str, Any]) -> str:
179
179
  regex_pattern = ""
180
+ relational_patterns = []
180
181
 
181
182
  # UUID (either explicit type 'uuid' or string with format 'uuid')
182
183
  if property.get("type") == "uuid" or (
@@ -234,6 +235,8 @@ class APISpecEditor:
234
235
  + rf"|^not-between::{regex_pattern},{regex_pattern},"
235
236
  + rf"|^in::{regex_pattern}(,{regex_pattern})*$"
236
237
  + rf"|^not-in::{regex_pattern}(,{regex_pattern})*$"
238
+ + rf"|^like::.+$"
239
+ + rf"|^not-like::.+$"
237
240
  )
238
241
 
239
242
  def generate_query_parameters(self, schema_object: dict[str, Any]):
@@ -620,9 +620,17 @@ class PathOperation(OpenAPIElement):
620
620
 
621
621
  def __init__(self, path: str, method: str, path_operation: Dict[str, Any]):
622
622
  super().__init__()
623
- self.entity = path.lower().rsplit("/", 1)[-1]
624
623
  self.action = METHODS_TO_ACTIONS[method]
625
624
 
625
+ parts = [p for p in path.lower().split("/") if p]
626
+ api_prefixes = {"api", "v1", "v2", "v3"}
627
+ literal_parts = [
628
+ p
629
+ for p in parts
630
+ if p not in api_prefixes and not (p.startswith("{") and p.endswith("}"))
631
+ ]
632
+ self.entity = "_".join(literal_parts)
633
+
626
634
  # Validate required x-af-database attribute
627
635
  if "x-af-database" not in path_operation:
628
636
  raise ApplicationException(
File without changes
File without changes
File without changes