Skip to content

Commit 4926b40

Browse files
feat: add weight validation in create_http_request_matcher factory
Validates weight >= 1 after interpolation/casting in the factory, catching invalid weights from manifest config before they reach the HttpRequestRegexMatcher constructor. Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
1 parent fea3ca1 commit 4926b40

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,6 +4393,8 @@ def create_http_request_matcher(
43934393
weight = int(InterpolatedString.create(weight, parameters={}).eval(config))
43944394
else:
43954395
weight = int(weight)
4396+
if weight < 1:
4397+
raise ValueError(f"weight must be >= 1, got {weight}")
43964398
return HttpRequestRegexMatcher(
43974399
method=model.method,
43984400
url_base=model.url_base,

0 commit comments

Comments
 (0)