cisco-en-programmability / dnacentersdk

Cisco DNA Center Python SDK
https://dnacentersdk.readthedocs.io/en/latest/
MIT License
70 stars 33 forks source link

Configuration template export project - request validator error #138

Closed MUTHU-RAKESH-27 closed 4 months ago

MUTHU-RAKESH-27 commented 10 months ago

Prerequisites

Describe the bug I was running the Ansible module for the cisco.dnac.configuration_template_export_project, which in turn calls the SDK, raises an exception that the list of project names is invalid. It says that it must be an object. Refer screenshots.

Expected behavior According to the DNA Cente's developer toolkit, the request body for the dna/intent/api/v1/template-programmer/project/name/exportprojects (POST) has to be a list of project names. Refer screenshots.

Screenshots Result of using API directly on DNAC developer toolkit, errors in code terminal and the Ansible playbook code.

Screenshot 2023-11-29 at 5 05 32 PM Screenshot 2023-11-29 at 5 10 01 PM Screenshot 2023-11-29 at 5 11 30 PM

Environment (please complete the following information):

HongPhatTL commented 9 months ago

I suggest a quick get-around is to set validate_response_schema value to false

image

MUTHU-RAKESH-27 commented 9 months ago

@HongPhatTL Still throwing the same error. Is this working fine for your issue?

HongPhatTL commented 9 months ago

Yes, @MUTHU-RAKESH-27. Absolutely !

When I set validate_response_schema: true, I get the same error as you had.

validate_true

When validate_response_schema: false, the error goes away.

validate_false

I argue that there are issues with the request validator in dnacentersdk: python3.8/site-packages/dnacentersdk/models/validators/v2_3_5_3/jsd_dc254215fdf25cd5b7ba797e8f8faebf.py (in term of my issue)

image

HongPhatTL commented 9 months ago

Hi @MUTHU-RAKESH-27, regarding your issue, please check file python3.8/site-packages/dnacentersdk/models/validators/v2_3_5_3/jsd_e6ea8c5d425cf9ac77006f5593725f.py

image

fmunozmiranda commented 8 months ago

Hi, @MUTHU-RAKESH-27 , temporaly please use parameter active_validation in SDK or validate_response_schema in ansible with False value. Actually we don´t have sufficient documentation for this endpoint. So it´s better if you just skip the validation.

If you´re using parameters and still getting troubles, please pass us DEBUG of your playbooks to help you.

Regards.

bvargasre commented 4 months ago

Since there is no documentation of the request body it was decided to remove the validation for this method. I will close the issue, in case the problem persists or another one arises feel free to reopen it or open a new issue.