A YANG model defines interface as a list keyed by name, and every entry holds a config container with the leaves mtu and enabled. An engineer validates the JSON instance a RESTCONF server returns for one configured entry. Which JSON structure matches that model?
Select an answer to reveal the explanation.
Short Explanation
YANG is the blueprint and JSON is the building, and the two only line up when the shapes match. A list always lands as an array of objects, while a container keeps its leaves nested inside one object. Flatten the structure or quote every value and you've broken the match.
Full Explanation
YANG and JSON line up through a small set of structural rules: a list becomes a JSON array because a list may hold many entries, and each entry becomes one object carrying its key leaf next to the rest of the data. A container has no value of its own, so it becomes a nested object that keeps its leaves grouped, while leaf types transfer as native JSON types, leaving mtu as a number and enabled as a boolean. Presenting interface as a single object ignores list cardinality and could not represent two interfaces at all. Flattening the container puts mtu and enabled beside name, which no longer matches the model even though the individual values look right. Writing both leaves as quoted strings treats them as text, so validation against the instantiated model fails on type. One exam caveat is that output formatting differs between implementations, but the structure defined by the module never changes. A practical check is to compare your payload against the YANG and confirm every list and container has the matching JSON shape.