Skip to content

Commit 7efc3e8

Browse files
committed
fix: assert list outside of loop to avoid redundancy
1 parent 6bbbd03 commit 7efc3e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samtranslator/model/api/api_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,12 @@ def _construct_api_domain( # noqa: PLR0912, PLR0915
554554
basepath_mapping = self._create_basepath_mapping(api_domain_name, rest_api, None, None)
555555
basepath_resource_list.extend([basepath_mapping])
556556
else:
557+
sam_expect(basepaths, self.logical_id, "Domain.BasePath").to_be_a_list_of(ExpectedType.STRING)
557558
for basepath in basepaths:
558559
if is_intrinsic(basepath):
559560
mapping_basepath = basepath
560561
logical_id = self.logical_id + "BasePathMapping"
561562
else:
562-
sam_expect(basepath, self.logical_id, "Domain.BasePath").to_be_a_list_of(ExpectedType.STRING)
563563
# Remove possible leading and trailing '/' because a base path may only
564564
# contain letters, numbers, and one of "$-_.+!*'()"
565565
path = "".join(e for e in basepath if e.isalnum())

0 commit comments

Comments
 (0)