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
I was working on the configuring and destination and notification and I came up with the issue that if in the Get API if we pass the filter parameter let say 'name' while invoking the Get Syslog Destination and with this name if no destination is present in the Catalyst Center then it will give response with status code 204 and the Exception message -
JSONDecodeError('Expecting value: line 1 column 1 (char 0)')
Problem is that the code in the dnacenter sdk attempted to decode an empty response body as JSON. Since the response status is 204 (No Content), this is expected behavior, but the code should handle it appropriately.
And there are multiple GET API calls having the same issue -
Get Syslog Destination
Get Syslog Subscription Details
Get Syslog Event Subscription
Get Rest/Webhook Subscriptions Details
Get Rest/Webhook Event Subscriptions
Get Email Subscriptions Details
Get Email Event Subscriptions
Expected behavior
Expectation is when API give response status code as 204 then it should be handled in the code as this indicates the empty response and not need to decode the empty response as JSON and instead of giving Execption code should handle it and return None or empty response like we do in other GET API's (For Example - Get Device List API in devices.)
Environment (please complete the following information):
Cisco DNA Center Version and patch: 2.3.7.6-70200
Python version: 3.9
SDK version: 2.9.1
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe the bug
I was working on the configuring and destination and notification and I came up with the issue that if in the Get API if we pass the filter parameter let say 'name' while invoking the Get Syslog Destination and with this name if no destination is present in the Catalyst Center then it will give response with status code 204 and the Exception message -
Problem is that the code in the dnacenter sdk attempted to decode an empty response body as JSON. Since the response status is 204 (No Content), this is expected behavior, but the code should handle it appropriately.
And there are multiple GET API calls having the same issue -
Expected behavior
Expectation is when API give response status code as 204 then it should be handled in the code as this indicates the empty response and not need to decode the empty response as JSON and instead of giving Execption code should handle it and return None or empty response like we do in other GET API's (For Example - Get Device List API in devices.)
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: