forked from loafle/openapi-generator-original
Merge pull request #580 from wing328/php_content_type
Fix content-type and accept in PHP API
This commit is contained in:
commit
8b8e8d70f9
@ -44,8 +44,12 @@ class {{classname}} {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = '{{#produces}}{{mediaType}}{{#hasMore}},{{/hasMore}}{{/produces}}';
|
$_header_accept = '{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}';
|
||||||
$headerParams['Content-Type'] = '{{#consumes}}{{mediaType}}{{#hasMore}},{{/hasMore}}{{/consumes}}';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}});
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
{{#queryParams}}// query params
|
{{#queryParams}}// query params
|
||||||
if(${{paramName}} !== null) {
|
if(${{paramName}} !== null) {
|
||||||
|
@ -43,8 +43,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = 'application/json,application/xml';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array('application/json','application/xml');
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -88,8 +92,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = 'application/json,application/xml';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array('application/json','application/xml');
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -133,8 +141,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($status !== null) {
|
if($status !== null) {
|
||||||
@ -183,8 +195,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($tags !== null) {
|
if($tags !== null) {
|
||||||
@ -233,8 +249,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -286,8 +306,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array('application/x-www-form-urlencoded');
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -338,8 +362,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
// header params
|
// header params
|
||||||
@ -388,8 +416,12 @@ class PetApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = 'multipart/form-data';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array('multipart/form-data');
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,8 +42,12 @@ class StoreApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -89,8 +93,12 @@ class StoreApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -140,8 +148,12 @@ class StoreApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -191,8 +203,12 @@ class StoreApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,8 +43,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -88,8 +92,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -133,8 +141,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -179,8 +191,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($username !== null) {
|
if($username !== null) {
|
||||||
@ -231,8 +247,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -272,8 +292,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -324,8 +348,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -373,8 +401,12 @@ class UserApi {
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$headerParams['Accept'] = 'application/json,application/xml';
|
$_header_accept = 'application/json, application/xml';
|
||||||
$headerParams['Content-Type'] = '';
|
if ($_header_accept !== '') {
|
||||||
|
$headerParams['Accept'] = $_header_accept;
|
||||||
|
}
|
||||||
|
$_header_content_type = array();
|
||||||
|
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user