From 37460ee833fd31a1f363037aa7a3950ade104307 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Mon, 7 Nov 2016 11:48:30 -0800 Subject: [PATCH] Select application/json content-type in python generated client, if */* is in the list of content-types --- .../src/main/resources/python/api_client.mustache | 2 +- samples/client/petstore/python/petstore_api/api_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 0a5864a81af..dc4fe509f62 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -462,7 +462,7 @@ class ApiClient(object): content_types = list(map(lambda x: x.lower(), content_types)) - if 'application/json' in content_types: + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: return content_types[0] diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index adf66173dbc..bd57c1089a4 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -462,7 +462,7 @@ class ApiClient(object): content_types = list(map(lambda x: x.lower(), content_types)) - if 'application/json' in content_types: + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: return content_types[0]