Skip to content

Commit a387205

Browse files
FaFrewing328
authored andcommitted
return a null instead of application/json when no content types are set (OpenAPITools#5941)
* return a null instead of application/json when no content types are set * update petstore sample Co-authored-by: William Cheng <[email protected]>
1 parent c5e5e65 commit a387205

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ namespace {{packageName}}.Client
169169
public static String SelectHeaderContentType(String[] contentTypes)
170170
{
171171
if (contentTypes.Length == 0)
172-
return "application/json";
172+
return null;
173173
174174
foreach (var contentType in contentTypes)
175175
{

samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static byte[] ReadAsBytes(Stream inputStream)
174174
public static String SelectHeaderContentType(String[] contentTypes)
175175
{
176176
if (contentTypes.Length == 0)
177-
return "application/json";
177+
return null;
178178

179179
foreach (var contentType in contentTypes)
180180
{

samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static byte[] ReadAsBytes(Stream inputStream)
174174
public static String SelectHeaderContentType(String[] contentTypes)
175175
{
176176
if (contentTypes.Length == 0)
177-
return "application/json";
177+
return null;
178178

179179
foreach (var contentType in contentTypes)
180180
{

0 commit comments

Comments
 (0)