Skip to content

ProjectAPI (api_projects_post) timeBudget & budget fields errors #5

Description

@mike1573

Getting "value should not be null" errors after posting a new project via the API following the documentation.

Code:

    api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
    body = kimai_python.ProjectEditForm('Test', 'Test', None, None, None, None, 1, 'd2d6de', 1)
    api_response = api_instance.api_projects_post(body)

Error:
Traceback (most recent call last):
File "taskhub.py", line 362, in
start()
File "taskhub.py", line 217, in start
api_response = proj_instance.api_projects_post('Wipro - Ingredion', 'Wipro - Ingredion', None, None, None, None, 1, 'd2d6de', 1)
TypeError: api_projects_post() takes 2 positional arguments but 10 were given
(kimai-env) gooncal@ip-72-167-226-99:~/kimai_api$ python taskhub.py
Traceback (most recent call last):
File "taskhub.py", line 362, in
start()
File "taskhub.py", line 217, in start
api_response = proj_instance.api_projects_post(obody)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api/pro ject_api.py", line 748, in api_projects_post
(data) = self.api_projects_post_with_http_info(body, **kwargs) # noqa: E501
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api/pro ject_api.py", line 818, in api_projects_post_with_http_info
collection_formats=collection_formats)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 330, in call_api
_preload_content, _request_timeout)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 161, in __call_api
_request_timeout=_request_timeout)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 373, in request
body=body)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/rest.py ", line 275, in POST
body=body)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/rest.py ", line 228, in request
raise ApiException(http_resp=r)
kimai_python.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Sat, 15 Aug 2020 13:32:55 GMT', 'Server': 'Apache/2.4.18 (Ubuntu)', 'Cache-Control': 'max-age=0, must-revalidate , private', 'Expires': 'Sat, 15 Aug 2020 13:32:55 GMT', 'Set-Cookie': 'PHPSESSID =77m9g58k2kvuvr3u2cg5p0k7id; path=/; HttpOnly', 'Connection': 'close', 'Transfer -Encoding': 'chunked', 'Content-Type': 'application/json'})
HTTP response body: {"code":400,"message":"Validation Failed","errors":{"childre n":{"name":{},"comment":{},"orderNumber":{},"orderDate":{},"start":{},"end":{}," customer":{},"color":{},"budget":{"errors":["This value should not be null."]}," timeBudget":{"errors":["This value should not be null."]},"visible":{}}}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions