domaintools-api 2.7.3__tar.gz → 2.7.4__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.
- {domaintools_api-2.7.3/domaintools_api.egg-info → domaintools_api-2.7.4}/PKG-INFO +1 -1
- domaintools_api-2.7.4/VERSION +1 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/_version.py +1 -1
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/decorators.py +4 -4
- {domaintools_api-2.7.3 → domaintools_api-2.7.4/domaintools_api.egg-info}/PKG-INFO +1 -1
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_api.py +0 -2
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_decorators.py +32 -0
- domaintools_api-2.7.3/VERSION +0 -1
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/LICENSE +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/README.md +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/__init__.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/api.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/base_results.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/__init__.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/api.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/__init__.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/accounts.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/detects.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/domains.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/feeds.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/ips.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/commands/iris.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/constants.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/main.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/cli/utils.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/constants.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/docstring_patcher.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/exceptions.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/filters.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/request_validator.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/results.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/specs/iris-openapi.yaml +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools/utils.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/SOURCES.txt +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/dependency_links.txt +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/entry_points.txt +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/requires.txt +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/top_level.txt +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_async/__init__.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/pyproject.toml +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/setup.cfg +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/setup.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_async.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_cli.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_docstring_patcher.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_filters.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_request_validator.py +0 -0
- {domaintools_api-2.7.3 → domaintools_api-2.7.4}/tests/test_utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.7.4
|
|
@@ -51,9 +51,7 @@ def api_endpoint(spec_name: str, path: str, methods: Union[str, List[str]]):
|
|
|
51
51
|
|
|
52
52
|
if "domains" in arguments.keys():
|
|
53
53
|
domains = arguments.pop("domains")
|
|
54
|
-
arguments["domain"] = (
|
|
55
|
-
",".join(domains) if isinstance(domains, (list, tuple)) else domains
|
|
56
|
-
)
|
|
54
|
+
arguments["domain"] = ",".join(domains) if isinstance(domains, (list, tuple)) else domains
|
|
57
55
|
|
|
58
56
|
if spec:
|
|
59
57
|
# Determine which HTTP method is currently being executed.
|
|
@@ -61,6 +59,8 @@ def api_endpoint(spec_name: str, path: str, methods: Union[str, List[str]]):
|
|
|
61
59
|
# Otherwise, default to the first method defined in the decorator.
|
|
62
60
|
current_method = kwargs.get("method", normalized_methods[0])
|
|
63
61
|
|
|
62
|
+
filtered_arguments = {k: v for k, v in arguments.items() if v is not None}
|
|
63
|
+
|
|
64
64
|
# Run Validation
|
|
65
65
|
# This will raise a ValueError and stop execution if validation fails.
|
|
66
66
|
try:
|
|
@@ -68,7 +68,7 @@ def api_endpoint(spec_name: str, path: str, methods: Union[str, List[str]]):
|
|
|
68
68
|
spec=spec,
|
|
69
69
|
path=path,
|
|
70
70
|
method=current_method,
|
|
71
|
-
parameters=
|
|
71
|
+
parameters=filtered_arguments,
|
|
72
72
|
)
|
|
73
73
|
except ValueError as e:
|
|
74
74
|
print(f"[Validation Error] {e}")
|
|
@@ -217,3 +217,35 @@ class TestApiEndpointDecorator:
|
|
|
217
217
|
call_kwargs = mock_validate.call_args[1]
|
|
218
218
|
|
|
219
219
|
assert call_kwargs.get("parameters") == {"name": "test-name"}
|
|
220
|
+
|
|
221
|
+
def test_none_arguments_are_filtered_before_validation(self, mock_client):
|
|
222
|
+
"""
|
|
223
|
+
Test that parameters with None values are excluded from the arguments
|
|
224
|
+
passed to the validator.
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
@api_endpoint(spec_name="v1", path="/users", methods="POST")
|
|
228
|
+
def create_user(name=None, status=None):
|
|
229
|
+
return "Success"
|
|
230
|
+
|
|
231
|
+
with patch("domaintools.request_validator.RequestValidator.validate") as mock_validate:
|
|
232
|
+
create_user(mock_client, name="Alice", status=None)
|
|
233
|
+
|
|
234
|
+
call_kwargs = mock_validate.call_args[1]
|
|
235
|
+
assert call_kwargs.get("parameters") == {"name": "Alice"}
|
|
236
|
+
assert "status" not in call_kwargs.get("parameters", {})
|
|
237
|
+
|
|
238
|
+
def test_all_none_arguments_passes_empty_parameters(self, mock_client):
|
|
239
|
+
"""
|
|
240
|
+
Test that when all arguments are None, an empty dict is passed to the validator.
|
|
241
|
+
"""
|
|
242
|
+
|
|
243
|
+
@api_endpoint(spec_name="v1", path="/users", methods="POST")
|
|
244
|
+
def create_user(name=None, body=None):
|
|
245
|
+
return "Success"
|
|
246
|
+
|
|
247
|
+
with patch("domaintools.request_validator.RequestValidator.validate") as mock_validate:
|
|
248
|
+
create_user(mock_client, name=None, body=None)
|
|
249
|
+
|
|
250
|
+
call_kwargs = mock_validate.call_args[1]
|
|
251
|
+
assert call_kwargs.get("parameters") == {}
|
domaintools_api-2.7.3/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{domaintools_api-2.7.3 → domaintools_api-2.7.4}/domaintools_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|