cisco-en-programmability/dnacentersdk

Dict_of_str not used in custom_caller

Closed this issue · 2 comments

erraa commented

Prerequisites

  • [x ] Have you tested the operation in the API directly?
  • [x ] Do you have the latest SDK version?

Describe the bug
When adding a custom api caller the headers aren't processed through the dict_of_str function

headers.update(kwargs.pop('headers'))

Expected behavior
Expecting the same behaviour as in the non custom modules.
Example:

_headers.update(dict_of_str(headers))

Environment (please complete the following information):

  • Cisco DNA Center Version and patch: N/A
  • Python version: N/A
  • SDK version: dnacentersdk==2.5.4
  • OS Version: N/A

Additional context
Workaround is to import it on your own.

from dnacentersdk.utils import dict_of_str

dnac.custom_caller.add_api("get_vns", lambda headers: dnac.custom_caller.call_api("GET", "api/v1/aca-controller-service/getAcaVnSummary", headers=dict_of_str(headers)))

Hi @erraa
dnacentersdk v2.5.5 is available. Feel free to test it and close or comment if necessary.

headers.update(dict_of_str(kwargs.pop('headers')))

Hi @erraa
Gently reminder to comment if there is any problem or doubt. If there are no comments, I will close this topic for inactivity this Wednesday.