Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_project receiving GET response #9

Open
fizix137 opened this issue Jun 7, 2022 · 1 comment
Open

create_project receiving GET response #9

fizix137 opened this issue Jun 7, 2022 · 1 comment
Labels
🐛Bug Something isn't working

Comments

@fizix137
Copy link

fizix137 commented Jun 7, 2022

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?

@fizix137 fizix137 changed the title Error responses due to non 200 status code create_project receiving GET response Jun 7, 2022
@JavierLuna
Copy link
Collaborator

Hi!

Could you post your INCEpTION and pycaprio version so I can follow up?
The steps needed to reproduce are just create a project? Could you reproduce it steadily?

@reckart reckart added the 🐛Bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants