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.api_id = api_id
|
||||||
self.path_part = path_part
|
self.path_part = path_part
|
||||||
self.parent_id = parent_id
|
self.parent_id = parent_id
|
||||||
self.resource_methods = {"GET": {}}
|
self.resource_methods = {}
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
response = {
|
response = {
|
||||||
"path": self.get_path(),
|
"path": self.get_path(),
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"resourceMethods": self.resource_methods,
|
|
||||||
}
|
}
|
||||||
|
if self.resource_methods:
|
||||||
|
response["resourceMethods"] = self.resource_methods
|
||||||
if self.parent_id:
|
if self.parent_id:
|
||||||
response["parentId"] = self.parent_id
|
response["parentId"] = self.parent_id
|
||||||
response["pathPart"] = self.path_part
|
response["pathPart"] = self.path_part
|
||||||
|
@ -208,7 +208,6 @@ def test_create_resource():
|
|||||||
"path": "/",
|
"path": "/",
|
||||||
"id": root_id,
|
"id": root_id,
|
||||||
"ResponseMetadata": {"HTTPStatusCode": 200},
|
"ResponseMetadata": {"HTTPStatusCode": 200},
|
||||||
"resourceMethods": {"GET": {}},
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -257,7 +256,6 @@ def test_child_resource():
|
|||||||
"parentId": users_id,
|
"parentId": users_id,
|
||||||
"id": tags_id,
|
"id": tags_id,
|
||||||
"ResponseMetadata": {"HTTPStatusCode": 200},
|
"ResponseMetadata": {"HTTPStatusCode": 200},
|
||||||
"resourceMethods": {"GET": {}},
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user