mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-10 00:21:19 +00:00
[python-nextgen] Add datetime, date format support (#14799)
* add datetime, date format support in python nextgen * encode query parameters * update default datetime format * change default datetime format
This commit is contained in:
@@ -145,14 +145,11 @@ class BodyApi(object):
|
||||
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
if _params['pet']:
|
||||
@@ -295,14 +292,11 @@ class BodyApi(object):
|
||||
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
if _params['pet']:
|
||||
|
||||
@@ -154,23 +154,22 @@ class FormApi(object):
|
||||
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
if _params['integer_form']:
|
||||
_form_params.append(('integer_form', _params['integer_form']))
|
||||
|
||||
if _params['boolean_form']:
|
||||
_form_params.append(('boolean_form', _params['boolean_form']))
|
||||
|
||||
if _params['string_form']:
|
||||
_form_params.append(('string_form', _params['string_form']))
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
@@ -154,23 +154,22 @@ class HeaderApi(object):
|
||||
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
if _params['integer_header']:
|
||||
_header_params['integer_header'] = _params['integer_header']
|
||||
|
||||
if _params['boolean_header']:
|
||||
_header_params['boolean_header'] = _params['boolean_header']
|
||||
|
||||
if _params['string_header']:
|
||||
_header_params['string_header'] = _params['string_header']
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
@@ -146,22 +146,20 @@ class PathApi(object):
|
||||
_path_params = {}
|
||||
if _params['path_string']:
|
||||
_path_params['path_string'] = _params['path_string']
|
||||
|
||||
if _params['path_integer']:
|
||||
_path_params['path_integer'] = _params['path_integer']
|
||||
|
||||
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
@@ -157,22 +157,27 @@ class QueryApi(object):
|
||||
# process the query parameters
|
||||
_query_params = []
|
||||
if _params.get('datetime_query') is not None: # noqa: E501
|
||||
_query_params.append(('datetime_query', _params['datetime_query']))
|
||||
if isinstance(_params['datetime_query'], datetime):
|
||||
_query_params.append(('datetime_query', _params['datetime_query'].strftime(self.api_client.configuration.datetime_format)))
|
||||
else:
|
||||
_query_params.append(('datetime_query', _params['datetime_query']))
|
||||
|
||||
if _params.get('date_query') is not None: # noqa: E501
|
||||
_query_params.append(('date_query', _params['date_query']))
|
||||
if isinstance(_params['date_query'], datetime):
|
||||
_query_parame.append(('date_query', _params['date_query'].strftime(self.api_client.configuration.date_format)))
|
||||
else:
|
||||
_query_params.append(('date_query', _params['date_query']))
|
||||
|
||||
if _params.get('string_query') is not None: # noqa: E501
|
||||
_query_params.append(('string_query', _params['string_query']))
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -315,21 +320,20 @@ class QueryApi(object):
|
||||
_query_params = []
|
||||
if _params.get('integer_query') is not None: # noqa: E501
|
||||
_query_params.append(('integer_query', _params['integer_query']))
|
||||
|
||||
if _params.get('boolean_query') is not None: # noqa: E501
|
||||
_query_params.append(('boolean_query', _params['boolean_query']))
|
||||
|
||||
if _params.get('string_query') is not None: # noqa: E501
|
||||
_query_params.append(('string_query', _params['string_query']))
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -465,14 +469,11 @@ class QueryApi(object):
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -608,14 +609,11 @@ class QueryApi(object):
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -751,14 +749,11 @@ class QueryApi(object):
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -894,14 +889,11 @@ class QueryApi(object):
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
@@ -1037,14 +1029,11 @@ class QueryApi(object):
|
||||
|
||||
# process the header parameters
|
||||
_header_params = dict(_params.get('_headers', {}))
|
||||
|
||||
# process the form parameters
|
||||
_form_params = []
|
||||
_files = {}
|
||||
|
||||
# process the body parameter
|
||||
_body_params = None
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
Reference in New Issue
Block a user