diff --git a/src/cloudforet/search/model/resource/response.py b/src/cloudforet/search/model/resource/response.py index cdbb7d4..68f1238 100644 --- a/src/cloudforet/search/model/resource/response.py +++ b/src/cloudforet/search/model/resource/response.py @@ -6,7 +6,7 @@ class ResourceResponse(BaseModel): resource_id: Union[str, None] = None name: Union[str, None] = None description: Union[str, None] = None - tags: dict = {} + tags: Union[dict, None] domain_id: str workspace_id: Union[str, None] = None project_id: Union[str, None] = None diff --git a/src/cloudforet/search/service/resource.py b/src/cloudforet/search/service/resource.py index 894aa4f..b85fd12 100644 --- a/src/cloudforet/search/service/resource.py +++ b/src/cloudforet/search/service/resource.py @@ -148,6 +148,7 @@ def search(self, params: ResourceSearchRequest) -> Union[ResourcesResponse, dict response_conf = self.search_conf.get(resource_type).get("response") response = self._make_response(results, next_token, response_conf) + print(response) return ResourcesResponse(**response) @@ -266,6 +267,8 @@ def _make_response( result = self._convert_result_by_alias(result, aliases) if tags: result = self._add_additional_info_to_tags(result, tags) + else: + result["tags"] = {} result["name"] = name_format.format(**result) result["resource_id"] = result[response_conf["resource_id"]]