You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 26, 2024. It is now read-only.
I am getting an error when I try to use the HAL codec, as follows:
python2.7/site-packages/coreapi/transports/http.py", line 249, in _decode_result
result = codec.load(response.content, **options)
TypeError: load() got an unexpected keyword argument 'content_type'
Looking at http.py around line 249, I can see that if a content-type header was returned, it's inserted into options.
if 'content-type' in response.headers:
options['content_type'] = response.headers['content-type']
Options is then unpacked and passed as parameters to codec.load(). The signature for the base codec is:
load(self, *args, **kwargs)
However the HAL codec has:
load(self, bytes, base_url=None)
This is unable to handle the content_type parameter. Changing this to the below gets everything working for me.
load(self, bytes, base_url=None, **kwargs)
Have I debugged this correctly? Happy to submit a PR if you agree that this correctly solves a valid issue.