-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
🐛BugSomething isn't workingSomething isn't working
Description
Running this code (edit for security):
from pycaprio import Pycaprio
client = Pycaprio("http://inception.instance.com", authentication=("user", "pass"))
client.api.create_project("test")
I got this back (edited for privacy, but all the good stuff is there.):
Traceback (most recent call last):
File "...\Local\Programs\Python\Python38\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 8, in <module>
File "...\venv\lib\site-packages\pycaprio\core\adapters\http_adapter.py", line 83, in create_project
return ProjectSchema().load(response.json()['body'])
File "...\venv\lib\site-packages\pycaprio\core\schemas\project.py", line 21, in load
return Project(project_dict['id'], project_dict['name'])
TypeError: list indices must be integers or slices, not str
I went into the http_adapter.py file and wrote code to print out response.json() and got:
{
'messages': [],
'body': [
{'id': 2,
'name': 'example_-concept-linking',
'title': 'Example: Concept Linking'},
{'id': 4,
'name': 'caprio',
'title': 'caprio'}
]
}
This looks like the body expected when submitted GET not POST. I ran this via the SwaggerUI and got back:
{
"messages": [],
"body": {
"id": 6,
"name": "test",
"title": "test"
}
}
What's going on here?
Metadata
Metadata
Assignees
Labels
🐛BugSomething isn't workingSomething isn't working