forked from loafle/openapi-generator-original
Custom Content type: better message and added tests (#12841)
* add tests for custom mime types * better message for custom mime type example handling * minor code format change
This commit is contained in:
parent
6dfbc58bb8
commit
60c5875091
@ -171,7 +171,7 @@ public class ExampleGenerator {
|
|||||||
output.add(kv);
|
output.add(kv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
kv.put(EXAMPLE, "null");
|
kv.put(EXAMPLE, "Custom MIME type example not yet supported: " + mediaType);
|
||||||
output.add(kv);
|
output.add(kv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1069,6 +1069,10 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ApiResponse'
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
|
||||||
|
# Export data as Excel spreadsheet.
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- 'write:pets'
|
- 'write:pets'
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -2033,7 +2033,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -2122,7 +2123,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -1654,7 +1654,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
request.Content.Headers.Add("ContentType", contentType);
|
request.Content.Headers.Add("ContentType", contentType);
|
||||||
|
|
||||||
string[] accepts = new string[] {
|
string[] accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
string? accept = ClientUtils.SelectHeaderAccept(accepts);
|
string? accept = ClientUtils.SelectHeaderAccept(accepts);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -1513,7 +1513,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
request.Content.Headers.Add("ContentType", contentType);
|
request.Content.Headers.Add("ContentType", contentType);
|
||||||
|
|
||||||
string[] accepts = new string[] {
|
string[] accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
string accept = ClientUtils.SelectHeaderAccept(accepts);
|
string accept = ClientUtils.SelectHeaderAccept(accepts);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -1513,7 +1513,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
request.Content.Headers.Add("ContentType", contentType);
|
request.Content.Headers.Add("ContentType", contentType);
|
||||||
|
|
||||||
string[] accepts = new string[] {
|
string[] accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
string accept = ClientUtils.SelectHeaderAccept(accepts);
|
string accept = ClientUtils.SelectHeaderAccept(accepts);
|
||||||
|
@ -880,7 +880,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -1871,7 +1871,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -1945,7 +1946,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -2033,7 +2033,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -2122,7 +2123,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -2033,7 +2033,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -2122,7 +2123,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -2033,7 +2033,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -2122,7 +2123,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
|
@ -844,7 +844,7 @@ catch (ApiException e)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
@ -2033,7 +2033,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
@ -2122,7 +2123,8 @@ namespace Org.OpenAPITools.Api
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
string[] _accepts = new string[] {
|
string[] _accepts = new string[] {
|
||||||
"application/json"
|
"application/json",
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
};
|
};
|
||||||
|
|
||||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user