Skip to content

Commit 66e3d70

Browse files
patrickgreenwellkeetonian
authored andcommitted
fix: fix issue when referencing RestApiId by Ref (#1396)
This handles the error of when referencing an API via Ref so that the dictionary check actually occurs. This makes the type checks equivalent and isn't as restrictive as the OrderedDict class
1 parent 47c5d7a commit 66e3d70

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

samtranslator/translator/translator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import copy
22
from samtranslator.model import ResourceTypeResolver, sam_resources
3-
from collections import OrderedDict
43
from samtranslator.translator.verify_logical_id import verify_unique_logical_id
54
from samtranslator.model.preferences.deployment_preference_collection import DeploymentPreferenceCollection
65
from samtranslator.model.exceptions import (
@@ -52,7 +51,7 @@ def _get_function_names(self, resource_dict, intrinsics_resolver):
5251
# adds to the function_names dict with key as the api_name and value as the function_name
5352
if item.get("Type") == "Api" and item.get("Properties") and item.get("Properties").get("RestApiId"):
5453
rest_api = item.get("Properties").get("RestApiId")
55-
if type(rest_api) == dict or isinstance(rest_api, OrderedDict):
54+
if type(rest_api) == dict or isinstance(rest_api, dict):
5655
api_name = item.get("Properties").get("RestApiId").get("Ref")
5756
else:
5857
api_name = item.get("Properties").get("RestApiId")

0 commit comments

Comments
 (0)