Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.
Expected Behavior
When JSON encoding is specified by the client (YDK RestconfClient), the client has support to correctly parse capabilities when the server response is JSON format. Currently, only an IetfCapabilitiesXmlParser is implemented, making YDK incompatible with servers that only support JSON encoding. The RESTCONF Protocol (RFC 8040) section 5.2 specifies that a server MUST support one of either XML or JSON encoding and that a server MAY support both. A JSON capabilities parser makes YDK compatible in parsing the ietf-restconf-monitoring:capabilities model when encoded in JSON format.
Current Behavior
The YDK RestconfClient currently hardcodes EncodingFormat.XML when making a request to the RESTCONF server for capabilities. Even when the end user of the RestconfClient specifies EncodingFormat.JSON, the capabilities request is still sent with EncodingFormat.XML.
Steps to Reproduce
1) Set up (build/install/etc) a YDK environment as specified by the documentation.
2) Acquire (or configure) a RESTCONF server that implements JSON encoding (specifically for capabilities endpoint).
3) Create an application that uses the YDK RestconfServiceProvider with EncodingFormat.JSON to connect to the server in step 2 (above).
4) Notice the error that the YDK RestconfClient is trying to parse XML when a JSON response is given.
Your Script
from __future__ import print_function
from ydk.providers import RestconfServiceProvider
from ydk.path import Repository
from ydk.types import EncodingFormat
import ydk
if __name__ == "__main__":
provider = RestconfServiceProvider(repo=Repository(REPO_PATH), address=TARGET_IP, username=TARGET_USER, password=TARGET_PASSWORD, port=PORT, encoding=EncodingFormat.JSON)
Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.
Expected Behavior
When JSON encoding is specified by the client (YDK RestconfClient), the client has support to correctly parse capabilities when the server response is JSON format. Currently, only an IetfCapabilitiesXmlParser is implemented, making YDK incompatible with servers that only support JSON encoding. The RESTCONF Protocol (RFC 8040) section 5.2 specifies that a server MUST support one of either XML or JSON encoding and that a server MAY support both. A JSON capabilities parser makes YDK compatible in parsing the ietf-restconf-monitoring:capabilities model when encoded in JSON format.
Current Behavior
The YDK RestconfClient currently hardcodes EncodingFormat.XML when making a request to the RESTCONF server for capabilities. Even when the end user of the RestconfClient specifies EncodingFormat.JSON, the capabilities request is still sent with EncodingFormat.XML.
Steps to Reproduce
1) Set up (build/install/etc) a YDK environment as specified by the documentation. 2) Acquire (or configure) a RESTCONF server that implements JSON encoding (specifically for capabilities endpoint). 3) Create an application that uses the YDK RestconfServiceProvider with EncodingFormat.JSON to connect to the server in step 2 (above). 4) Notice the error that the YDK RestconfClient is trying to parse XML when a JSON response is given.
Your Script
Logs
Enable logging and post the logs below
System Information
Python 3.8.10 Ubuntu 20.04.6 LTS Intel x86_64