Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-958

YANG parser does not complain about mandatory node in a default case

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Low
    • Resolution: Unresolved
    • 2.0.10
    • None
    • parser

    Description

      We are using version 2.0.11.

      The YANG parser does not complain when you put a mandatory node in a default case in a choice (see the attached model). We saw this when we had a nested choice in a default case that was mandatory, but actually it is also the case if a default case contains directly a mandatory leaf.

      According to the RFC this is not allowed. See section https://tools.ietf.org/html/rfc7950#section-7.9.3

      pyang is giving an error on this:
      example.yang:11: error: mandatory node in default case
      example.yang:15: error: mandatory node in default case

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            verthezpw Peter Verthez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: