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

resolve issue that yang-model-validator tool fails when parsing geo-uri

    XMLWordPrintable

Details

    • Bug
    • Status: Verified
    • Medium
    • Resolution: Won't Do
    • None
    • None
    • None
    • None

    Description

      The below yang file (experimental/ietf-extracted-YANG-modules/iana-geo-uri-type@2014-05-08.yang)
      fails validation because of the single quote in this line:

      + '(=(([-_.!~*'()[]:&+$da-zA-Z]*)(%[da-fA-F]{2})*)*)?)*'; 
      submodule iana-geo-uri-type {
        belongs-to "ietf-location" {
          prefix loc;
        }  import ietf-yang-types {
          prefix yang;
        }  organization "IANA";
        contact
          "        Internet Assigned Numbers Authority     Postal: ICANN
                   4676 Admiralty Way, Suite 330
                   Marina del Rey, CA 90292     Tel:    +1 310 823 9358
           E-Mail: iana&iana.org";
        description
          "This YANG module defines the iana-geo-uri-type typedef,
           which contains YANG definitions for IANA-registered geo uri.     This YANG module is maintained by IANA, serializes the existing
           'geo' URI into YANG format, and reflects the 'geo URI
           Parameters' registry and 'geo URI crs Parameter Values'
           sub-registry.     The latest revision of this YANG module can be obtained from
           the IANA web site.     Requests for new values should be made to IANA via
           email (iana&iana.org).
           Copyright (c) 2014 IETF Trust and the persons identified as
           authors of the code.  All rights reserved.     Redistribution and use in source and binary forms, with or
           without modification, is permitted pursuant to, and subject
           to the license terms contained in, the Simplified BSD License
           set forth in Section 4.c of the IETF Trust's Legal Provisions
           Relating to IETF Documents
           (http://trustee.ietf.org/license-info).";  revision 2014-05-08 {
          description
            "Initial revision.";
        }  typedef geo-uri {
          type yang:uri {
            pattern
              'geo:'
            + '-?0*(90|(([1-8][0-9]|[0-9])(.[0-9]*)?))'
            + ',-?0*(180|((1[0-7][0-9]|[1-9][0-9]|[0-9])(.[0-9]*)?))'
            + '(,-?[0-9]+(.[0-9]*)?)?'
            + '(;crs=(wgs84|[-0-9a-zA-Z]+))?'
            + '(;u=[0-9]+(.[0-9]*)?)?'
            + '(;[-da-zA-Z]+'
            + '(=(([-_.!~*()[]:&+$da-zA-Z]*)(%[da-fA-F]{2})*)*)?)*';
          }
          description
            "The geo-uri type reprents a Uniform Resource Identifier for
             Geographic Locations ('geo' URI) as defined by RFC 5870.";
          reference
            "RFC 5870: A Uniform Resource Identifier for Geographic
             Locations";
        }
      }

      This may just be a bug in the yang file and the parser is correctly failing, but I am not confident either way so
      filing this issue in case someone knows better.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jluhrsen Jamo Luhrsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: