diff --git a/botocore/parsers.py b/botocore/parsers.py index 99eb4e3409..57d499fa7e 100644 --- a/botocore/parsers.py +++ b/botocore/parsers.py @@ -428,11 +428,6 @@ def _inject_response_metadata(self, node, inject_into): sub_mapping[key] = value.text inject_into['ResponseMetadata'] = sub_mapping - def _handle_string(self, shape, node): - return node.text - - _handle_character = _handle_string - class EC2QueryParser(QueryParser): diff --git a/tests/unit/protocols/output/ec2.json b/tests/unit/protocols/output/ec2.json index a85607a65d..5b76bf5fda 100644 --- a/tests/unit/protocols/output/ec2.json +++ b/tests/unit/protocols/output/ec2.json @@ -413,5 +413,42 @@ } } ] + }, + { + "description": "Empty string", + "metadata": { + "protocol": "ec2" + }, + "shapes": { + "OutputShape": { + "type": "structure", + "members": { + "Foo": { + "shape": "StringType" + } + } + }, + "StringType": { + "type": "string" + } + }, + "cases": [ + { + "given": { + "output": { + "shape": "OutputShape" + }, + "name": "OperationName" + }, + "result": { + "Foo": "" + }, + "response": { + "status_code": 200, + "headers": {}, + "body": "requestid" + } + } + ] } ] diff --git a/tests/unit/protocols/output/query.json b/tests/unit/protocols/output/query.json index 5ffd5ac263..eee10b8301 100644 --- a/tests/unit/protocols/output/query.json +++ b/tests/unit/protocols/output/query.json @@ -772,5 +772,42 @@ } } ] + }, + { + "description": "Empty string", + "metadata": { + "protocol": "query" + }, + "shapes": { + "OutputShape": { + "type": "structure", + "members": { + "Foo": { + "shape": "StringType" + } + } + }, + "StringType": { + "type": "string" + } + }, + "cases": [ + { + "given": { + "output": { + "shape": "OutputShape" + }, + "name": "OperationName" + }, + "result": { + "Foo": "" + }, + "response": { + "status_code": 200, + "headers": {}, + "body": "requestid" + } + } + ] } ] diff --git a/tests/unit/protocols/output/rest-xml.json b/tests/unit/protocols/output/rest-xml.json index ba1f09ffa8..705422564f 100644 --- a/tests/unit/protocols/output/rest-xml.json +++ b/tests/unit/protocols/output/rest-xml.json @@ -679,5 +679,42 @@ } } ] + }, + { + "description": "Empty string", + "metadata": { + "protocol": "rest-xml" + }, + "shapes": { + "OutputShape": { + "type": "structure", + "members": { + "Foo": { + "shape": "StringType" + } + } + }, + "StringType": { + "type": "string" + } + }, + "cases": [ + { + "given": { + "output": { + "shape": "OutputShape" + }, + "name": "OperationName" + }, + "result": { + "Foo": "" + }, + "response": { + "status_code": 200, + "headers": {}, + "body": "requestid" + } + } + ] } ]