freeconf / yang

Standards-based management for Golang microservices
Apache License 2.0
38 stars 15 forks source link

strict argument parsing for leaf-list `min-elements` incompatible with some IETF models #114

Closed william-tremblay1 closed 1 month ago

william-tremblay1 commented 1 month ago

IETF models ietf-l3vpn-svc and ietf-routing use a string as the value of the leaf-list min-elements key, i.e. min-elements "1" instead of min elements 1. Pyang accepts this, but the freeconf parser doesn't. RFC 7950 seems ambiguous about it, using < a string that matches the rule >

  min-elements-stmt   = min-elements-keyword sep
                         min-value-arg-str stmtend

   min-value-arg-str   = < a string that matches the rule >
                         < min-value-arg >

   min-value-arg       = non-negative-integer-value

Although there were no instances of IETF models using max-elements with a string argument, I suspect a similar inconsistency would be present there.

dhubler commented 1 month ago

Likely freeconf issue but easy fix I can look into

On Fri, Jul 19, 2024, 1:51 PM William Tremblay @.***> wrote:

IETF models ietf-l3vpn-svc https://github.com/YangModels/yang/blob/main/standard/ietf/RFC/ietf-l3vpn-svc%402018-01-19.yang and ietf-routing https://github.com/YangModels/yang/blob/main/standard/ietf/RFC/ietf-routing%402018-03-13.yang use a string as the value of the leaf-list min-elements key, i.e. min-elements "1" instead of min elements 1. Pyang accepts this, but the freeconf parser doesn't. RFC 7950 https://datatracker.ietf.org/doc/html/rfc7950#section-14 seems ambiguous about it, using < a string that matches the rule >

min-elements-stmt = min-elements-keyword sep min-value-arg-str stmtend

min-value-arg-str = < a string that matches the rule > < min-value-arg >

min-value-arg = non-negative-integer-value

Although there were no instances of IETF models using max-elements with a string argument, I suspect a similar inconsistency would be present there.

— Reply to this email directly, view it on GitHub https://github.com/freeconf/yang/issues/114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACA7VY4QPV3LRSJYIUP63ZNFGYHAVCNFSM6AAAAABLE74IY2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTSNJQHA3DQNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dhubler commented 1 month ago

should be fixed in HEAD. other repos like restconf will eventually be updated