-
Notifications
You must be signed in to change notification settings - Fork 26
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
KeyError 'Id' in _unwrap_response_single (creating callbacks) #154
Comments
# bunq/sdk/model/core/bunq_model.py:56
@classmethod
def _unwrap_response_single(cls,
obj: Dict,
wrapper: str = None)
...
# bunq/sdk/model/core/bunq_model.py:60
if wrapper is not None:
return obj[cls._FIELD_RESPONSE][cls._INDEX_FIRST][wrapper]
from bunq.sdk.model.generated.endpoint import NotificationFilterUrlUser, NotificationFilterUrlMonetaryAccount
if cls == NotificationFilterUrlUser or cls == NotificationFilterUrlMonetaryAccount:
return obj[cls._FIELD_RESPONSE][cls._INDEX_FIRST]['NotificationFilterUrl']
else:
return obj[cls._FIELD_RESPONSE][cls._INDEX_FIRST][wrapper]
# bunq/sdk/model/core/bunq_model.py:91
@classmethod
def _from_json_list(cls,
response_raw: BunqResponseRaw,
wrapper: str = None)
...
# bunq/sdk/model/core/bunq_model.py:102
for item in array:
item_unwrapped = item if wrapper is None else item[wrapper]
# item_unwrapped needs to be deserialized to NotificationFilterUrl (wrapper)
# when cls is NotificationFilterUrlUser or NotificationFilterUrlMonetaryAccount
if wrapper=='NotificationFilterUrl':
from bunq.sdk.model.generated.endpoint import NotificationFilterUrlUser, NotificationFilterUrlMonetaryAccount
from bunq.sdk.model.generated.object_ import NotificationFilterUrl
if cls == NotificationFilterUrlUser or cls == NotificationFilterUrlMonetaryAccount:
cls_orig = cls
cls = NotificationFilterUrl
#print(f'NotificationFilterUrlUser deserialization, changing cls from: {cls_orig} to: {cls}')
#TODO: Test deserialize for NotificationFilterUrlUser and NotificationFilterUrlMonetaryAccount Please see: |
Steps to reproduce:
(only showing the callback part here)
What should happen:
(also tinker example is old)
What happens:
Traceback
SDK version and environment
Response id
There it fails. There is no response Id in this object....
Extra info:
As response we get this object:
Now in _unwrap_response_single we do this:
So if we take the first element of "Response" there is no "Id". Only a NotificationFilterUrl...
And then again there is no "Id" only a "id"...
The text was updated successfully, but these errors were encountered: