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

"resource_create" curl command is not working with right_time_context extension #17

Open
Nisha1293 opened this issue Aug 22, 2023 · 0 comments

Comments

@Nisha1293
Copy link

Issue Description:
I integrated a "ckanext-right_time_context" extnesion with CKAN.
When I executed the "resource_create" API, it returned the below error :

[Tue Aug 15 17:33:43.157707 2023] [wsgi:error] [pid 137:tid 140601585772288] [remote 10.26.3.147:03245]   return self._serialize_resource(resource)
[Tue Aug 15 17:33:43.157710 2023] [wsgi:error] [pid 137:tid 140601585772288] [remote 10.26.3.147:03245] File '/usr/lib/ckan/default/src/ckanext-right_time_context/ckanext/right_time_context/plugin.py', line 175 in _serialize_resource
[Tue Aug 15 17:33:43.157713 2023] [wsgi:error] [pid 137:tid 140601585772288] [remote 10.26.3.147:03245]   if resource['format'] == NGSI_REG_FORMAT:
[Tue Aug 15 17:33:43.157715 2023] [wsgi:error] [pid 137:tid 140601585772288] [remote 10.26.3.147:03245] KeyError: 'format'

Investigation:
On the investigation, I found that "format" key has not been passed in the curl command. As per the document "format" key is optional in resource_create API.

Further when I investigated in the right-time-context source code, I found that in the following file "/usr/lib/ckan/default/src/ckanext-right_time_context/ckanext/right_time_context/plugin.py" at line no 175, currently below condition is checked.

if resource['format'] == NGSI_REG_FORMAT:

When resource_create API is executed without "format" key, it returns the error because format key is not there.

Expected Behaviour:

resource_create API should be working without passing format key in the curl command.

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

1 participant