[YANGTOOLS-212] JSON in and out of MD-SAL is Inconsistent Created: 12/Jul/14  Updated: 10/Apr/22  Resolved: 14/Jul/14

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Reinaldo Penno Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC



 Description   

https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:EverythingYouWantedtoKNowaboutOnDataChanged_butWasAfraidToAsk#JSON_in_and_out_of_MD-SAL_is_Inconsistent



 Comments   
Comment by Tony Tkacik [ 14/Jul/14 ]

Based on your description you used third-party reflection-based general-purposed JSON serializers. You could not expect output to conform to any YANG specific serialization or remotly be similar to Restconf one.

It is out of scope of Binding Specification to support out-of-the box restconf compliant serialization to json using third-party libraries.

Binding specification

  • was design to provide compile-type representation of YANG modeled data
  • preserve semantical concepts (e.g. only one case applicable for choice,
    augmentations, identities| as much as possible in compilation type), not
    serialization specific ones.

Binding specification was never intended to provide easy RFC6020 or yang-json-api complient serialization to XML/JSON, but rather be independent from serialization to textual payload.

If you want an utility to generate JSON out of binding DTO outside of restconf, please open enhancement bug for MD-SAL. We have utilities which provides you with XML output, but none for JSON.

Opened folow-up enhancement https://bugs.opendaylight.org/show_bug.cgi?id=1360
since this is out-of-scope of Binding Specification or YANGTools and may be fixed by introduction of utility service and not changing binding specification.

Generated at Wed Feb 07 20:52:35 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.