core-wg / yang-cbor

Internet-Draft for CBOR representation of YANG data
5 stars 10 forks source link

how to handle deviate(replace) for a data type #148

Open abierman opened 1 year ago

abierman commented 1 year ago

deviations allow types to be changed

leaf foo { type int32; }

deviation "/foo" {
   deviate replace {
       type string;
   }
}

The deviation is always in a different YANG module that the changed objects.

The SID file ignores server deviations -- which is correct since the type info is not in the SID file.

In this case the server will send leaf /foo as a string and not an int32. The client is expected to apply the deviations advertised by the server and expect a string for leaf /foo and not int32.

This is being done in the wild (much to my protests)

mcr commented 1 year ago

The deviation is always in a different YANG module that the changed objects.

So, it should get allocations from a different SID range, right?

abierman commented 1 year ago

Deviations do not get SID assignments. They do not change the meaning of any SID assignments.

The YANG to CBOR encoding of a leaf or leaf-list is based on the "effective schema" which might be a composite of YANG modules and deviations.

To be clear:

lemikev commented 1 year ago

We might still want to allow the assignment of a SID to the name of a deviation module to enable the compression of 'ietf-yang-libra'. Something similar to 'draft-ietf-core-yang-library'.

Regards, Michel

From: Andy Bierman @.> Sent: 3 février 2023 17:54 To: core-wg/yang-cbor @.> Cc: Subscribed @.***> Subject: Re: [core-wg/yang-cbor] how to handle deviate(replace) for a data type (Issue #148)

External Email: Please use caution when opening links and attachments / Courriel externe: Soyez prudent avec les liens et documents joints

Deviations do not get SID assignments. They do not change the meaning of any SID assignments.

The YANG to CBOR encoding of a leaf or leaf-list is based on the "effective schema" which might be a composite of YANG modules and deviations.

To be clear:

- Reply to this email directly, view it on GitHubhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcore-wg%2Fyang-cbor%2Fissues%2F148%23issuecomment-1416500054&data=05%7C01%7CMichel.Veillette%40trilliant.com%7Cb8898ddc95ad43e9d04208db06397b32%7C4f6fbd130dfb415085c3d43260c04309%7C0%7C0%7C638110616177107965%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Wc2QrRu1SPZ3QDY%2FN33pc18kXWIg0F9bh%2BHzCJqojI4%3D&reserved=0, or unsubscribehttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADZVLN6BZOREST2WKWDK2OTWVWD65ANCNFSM6AAAAAAUQPORIM&data=05%7C01%7CMichel.Veillette%40trilliant.com%7Cb8898ddc95ad43e9d04208db06397b32%7C4f6fbd130dfb415085c3d43260c04309%7C0%7C0%7C638110616177107965%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bTylMjE755vhHm9%2BIfTQMeMlzXwSHHgX127M6sF5JuY%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

abierman commented 1 year ago

Actually a deviation module is just another YANG module. It is allowed to have any statements in it. Just convention keeps them separate.

The module itself is already getting a SID assignment

cabo commented 1 year ago

I think I understand the gist of this discussion. I'm wondering if any changes/additions are needed to the text. I think I could create some from this thread, but does this belong/need to be in the document?