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

Issue with POST, PUT, and DELETE Requests in OBA #183

Open
tanosk895 opened this issue Feb 21, 2025 · 2 comments
Open

Issue with POST, PUT, and DELETE Requests in OBA #183

tanosk895 opened this issue Feb 21, 2025 · 2 comments

Comments

@tanosk895
Copy link

I have successfully used the GET ALL and GET by ID requests, but I am experiencing issues with the POST, PUT, and DELETE requests. When trying to perform a POST request, I encounter the following server error in the query_manager class from the OBASPARQL package, at line 382:

body = body.dict() AttributeError: 'Employee' object has no attribute 'dict'

Image

ents/assets/48431671-3f71-4a83-891a-23c47248c10f)

I would really appreciate any guidance you could provide on this issue. Is there something I might be missing in the request formatting or object definition?

@dgarijo
Copy link
Contributor

dgarijo commented Feb 21, 2025

@tanosk895,
It looks like the resource being posted is not being received appropriately. I do not know what the problem may be in detail, though @mosoriob maybe you know?

Which version are you trying? Maybe give a try to version 3.6.1?

@tanosk895
Copy link
Author

tanosk895 commented Feb 21, 2025

Thank you for your quick response, I am using the latest version 3.6.1

In the post of the generated resource, I am passing a body:
{
“id": ‘12345’,
“hasPhone“: [”123213213"],
“description": null,
“label": null,
“type": null,
“ssn": null
}

This is the post I am trying to make

curl -X 'POST'
'http://localhost:8080/v1/employees?user=pizza'
-H 'accept: application/json'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpVCJ9.eyJpc3MiOiJjb20uemFsYW5kby5jb25uZXhpb24iLCJpYXQiOjE3NDAxMzQ0OTYsImV4cCI6MTgwMDEzNDQ5Niwic3ViIjoidGVzdEB0ZXN0Lml0In0.ULBa3lS29sYk1IGovHcrMI65AJ-SkisLxp2Poajsn6c'
-H 'Content-Type: application/json'
-d '{
"id": "12345",
"hasPhone": ["123213213"],
"description": null,
"label": null,
"type": null,
"ssn": null
}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants