Subject: [netconf] JSON-Patch versus YANG-Patch comparison

From: Balázs Lengyel <[email-masked]>
Date: Mon, 23 Mar 2020 14:49:16 +0000

Hello,

As a part outsider in RestConf, I would like to ask what is the difference
between YANG Patch (rfc8072) and JSON Patch (rfc6902)? 

Regards Balazs

-- 

Balazs Lengyel                    Senior Specialist
Ericsson Hungary Ltd. 

Mobile: +36-70-330-7909              email: [email-masked]

---

From: Jan Lindblad <[email-masked]>
Date: Mon, 23 Mar 2020 15:57:31 +0100

Balász,

> As a part outsider in RestConf, I would like to ask what is the difference between YANG Patch (rfc8072) and JSON Patch (rfc6902)? 

Observed from a sufficiently high level, they do more or less the same thing. When you get into the details, the differences quickly become apparent. In YANG-Patch the set of operations match exactly those you are used to from the NETCONF world. The path encoding (including XML namespaces) is NETCONF style. The values are encoded as you would expect from the YANG-JSON mapping.

/jan

---

From: Balázs Lengyel <[email-masked]>
Date: Mon, 23 Mar 2020 15:46:32 +0000

So we just wanted a nicer format for the same functionality?

Regards Balazs

From: Jan Lindblad <[email-masked]> 
Sent: 2020. március 23., hétfő 15:58
To: Balázs Lengyel <[email-masked]>
Cc: [email-masked]
Subject: Re: [netconf] JSON-Patch versus YANG-Patch comparison

Balász,

/jan

---

From: Andy Bierman <[email-masked]>
Date: Mon, 23 Mar 2020 08:52:53 -0700

> So we just wanted a nicer format for the same functionality?

If you believe that patching a JSON instance document is exactly the same as
patching a NETCONF datastore, then yes, this is the same functionality.

> Regards Balazs

Andy

>
>
> *From:* Jan Lindblad <[email-masked]>
> *Sent:* 2020. március 23., hétfő 15:58
> *To:* Balázs Lengyel <[email-masked]>
> *Cc:* [email-masked]
> *Subject:* Re: [netconf] JSON-Patch versus YANG-Patch comparison
>
>
>
> Balász,
>
>
>
> Observed from a sufficiently high level, they do more or less the same
> thing. When you get into the details, the differences quickly become
> apparent. In YANG-Patch the set of operations match exactly those you are
> used to from the NETCONF world. The path encoding (including XML
> namespaces) is NETCONF style. The values are encoded as you would expect
> from the YANG-JSON mapping.
>
>
>
> /jan
>
>
> _______________________________________________
> netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
>

---

From: Andy Bierman <[email-masked]>
Date: Wed, 25 Mar 2020 10:28:12 -0700

> from the YANG-JSON mapping.

We looked at JSON Patch when YANG Patch was being designed, but it was not
seriously considered
for 2 reasons:

1) YANG is intended to be encoding-independent and we already had XML to
support
     The solution could not be JSON-specific

2) YANG identifies multiple instances of the same schema node with key
leafs.
    This provides predictable stable instance naming which is critical for
network management.
    JSON has packed arrays for which there is an integer index. If an entry
is inserted or removed
    then the instances renumber to keep the array packed.

Andy

/jan