Fix default resourceMethod for API Gateway. Closes #2750.
This commit is contained in:
parent
6b6a059350
commit
356c55f99d
@ -117,14 +117,15 @@ class Resource(BaseModel):
|
||||
self.api_id = api_id
|
||||
self.path_part = path_part
|
||||
self.parent_id = parent_id
|
||||
self.resource_methods = {"GET": {}}
|
||||
self.resource_methods = {}
|
||||
|
||||
def to_dict(self):
|
||||
response = {
|
||||
"path": self.get_path(),
|
||||
"id": self.id,
|
||||
"resourceMethods": self.resource_methods,
|
||||
}
|
||||
if self.resource_methods:
|
||||
response["resourceMethods"] = self.resource_methods
|
||||
if self.parent_id:
|
||||
response["parentId"] = self.parent_id
|
||||
response["pathPart"] = self.path_part
|
||||
|
@ -208,7 +208,6 @@ def test_create_resource():
|
||||
"path": "/",
|
||||
"id": root_id,
|
||||
"ResponseMetadata": {"HTTPStatusCode": 200},
|
||||
"resourceMethods": {"GET": {}},
|
||||
}
|
||||
)
|
||||
|
||||
@ -257,7 +256,6 @@ def test_child_resource():
|
||||
"parentId": users_id,
|
||||
"id": tags_id,
|
||||
"ResponseMetadata": {"HTTPStatusCode": 200},
|
||||
"resourceMethods": {"GET": {}},
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user