diff --git a/connexion/api.py b/connexion/api.py index c64744259..8a968d0ba 100644 --- a/connexion/api.py +++ b/connexion/api.py @@ -123,7 +123,7 @@ def __init__(self, swagger_yaml_path, base_url=None, arguments=None, # A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific # API calls. - self.produces = self.specification.get('produces', ['application/json']) # type: List[str] + self.produces = self.specification.get('produces', list()) # type: List[str] # A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific # API calls. diff --git a/tests/api/test_responses.py b/tests/api/test_responses.py index 0d771dc97..d940dea75 100644 --- a/tests/api/test_responses.py +++ b/tests/api/test_responses.py @@ -171,8 +171,5 @@ def test_bad_operations(bad_operations_app): def test_text_request(simple_app): app_client = simple_app.app.test_client() - resp = app_client.post('/v1.0/text-request', data=u'text') + resp = app_client.post('/v1.0/text-request', data='text') assert resp.status_code == 200 - assert resp.content_type == 'text/plain; charset=utf-8' - # validate text content - assert resp.data == u'text' diff --git a/tests/fakeapi/hello.py b/tests/fakeapi/hello.py index 5bb6afbb3..c5a9e8d81 100755 --- a/tests/fakeapi/hello.py +++ b/tests/fakeapi/hello.py @@ -331,7 +331,7 @@ def get_data_as_binary(): def get_data_as_text(post_param): - return post_param, 200, {'Content-Type': 'text/plain; charset=utf-8'} + return '' def get_invalid_response(): diff --git a/tests/fixtures/simple/swagger.yaml b/tests/fixtures/simple/swagger.yaml index fdce196ea..4d713388d 100644 --- a/tests/fixtures/simple/swagger.yaml +++ b/tests/fixtures/simple/swagger.yaml @@ -635,8 +635,6 @@ paths: operationId: fakeapi.hello.get_data_as_text consumes: - "text/plain" - produces: - - "text/plain" parameters: - name: post_param description: Just a testing parameter. @@ -646,9 +644,7 @@ paths: type: string responses: 200: - description: Everything is ok - schema: - type: string + description: OK definitions: