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

Report error if default value for typedef fails constraint validation from typedef or base typedef

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    Description

      Yangtools should be augmented to report an error in the following block:

      typedef listen-ipv4-address

      { type iit:ipv4-address; //default "0.0.0.0"; default "xxx"; }

      The value of "xxx" provided for "default" does not match the constraints of the base type (ipv4-address), which is defined by a pattern.

      In the Xored YangIDE Eclipse plugin, which uses Yangtools, this does not report an error.

      In constrast, the Pyang Python compiler reports the following:

      error: the value "xxx" does not match its base type at ietf-inet-types.yang:179 - pattern mismatch for the default value for pattern defined at ietf-inet-types.yang:184

      This is as used in the Yang Design Studio Eclipse plugin, which utilizes Pyang.

      When I reported this in the yangtools-dev mailing list, Robert Varga indicated "it would require
      the parser to have knowledge of data type binding – something which it currently does not have."

      I'm interested in any issues that show a disparity between what pyang acknowledges as valid Yang code, compared to Yangtools. This isn't to be "competitive", it's simply to provide consistency with other tools in the domain.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              dkarr David M. Karr
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: