Skip to content

JSONDecodeError: Expecting value #162

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

Closed
ranjitmishra opened this issue Jul 14, 2021 · 3 comments
Closed

JSONDecodeError: Expecting value #162

ranjitmishra opened this issue Jul 14, 2021 · 3 comments
Labels
V4 OData V4

Comments

@ranjitmishra
Copy link

I can get entity set list. Then I try to get all entities by the following ---
company = clinet.entity_sets.Company.get_entities().select('companyId,name').execute()

the above piece of code fails with "JSONDecodeError: Expecting value" .
Is it not getting values in the source data? MS Excel Odata works fine with this set of source data, so I would not believe that source data has any issues. Any help is greatly appreciated.

@jfilak
Copy link
Contributor

jfilak commented Jul 14, 2021

Thank you for taking the time to report this issue.
Please, enable logging and provide the request and the response: https://pyodata.readthedocs.io/en/latest/usage/advanced.html#enable-logging

@ranjitmishra
Copy link
Author

Thanks for your kind help. The request is as below - DEBUG:pyodata.service:Send (execute) GET request to https://odata.restaurant365.net/api/v2/views/%24metadata#Company/Company
DEBUG:pyodata.service:  query params: {'$select': 'companyId,name'}
DEBUG:pyodata.service:  headers: {'Accept': 'application/json'}
DEBUG:urllib3.connectionpool:Resetting dropped connection: odata.restaurant365.net
DEBUG:urllib3.connectionpool:https://odata.restaurant365.net:443 "GET /api/v2/views/%24metadata?$select=companyId,name HTTP/1.1" 200 16107

And the response is as follows - DEBUG:pyodata.service:Received response
DEBUG:pyodata.service:  url: https://odata.restaurant365.net/api/v2/views/%24metadata?$select=companyId,name#Company/Company
DEBUG:pyodata.service:  headers: {'Cache-Control': 'no-cache', 'Pragma': 'no-cache', 'Content-Length': '16107', 'Content-Type': 'application/xml', 'Expires': '-1', 'Server': 'Microsoft-IIS/10.0', 'OData-Version': '4.0', 'X-AspNet-Version': '4.0.30319', 'Request-Context': 'appId=cid-v1:b3430de1-2e1a-4491-8fc8-fa8f5a9bf518', 'X-Powered-By': 'ASP.NET', 'Date': 'Thu, 15 Jul 2021 10:47:39 GMT'}
DEBUG:pyodata.service:  status code: 200
myapp.log  

@phanak-sap
Copy link
Contributor

Note, this is Odata v4 service.

snippet from provided headers: 'OData-Version': '4.0',
metadata header <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">

At the moment pyodata supports only Odata v2, watch for issue #39

@phanak-sap phanak-sap added the V4 OData V4 label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V4 OData V4
Projects
None yet
Development

No branches or pull requests

3 participants