I believe if you remove the anchor characters ^ and & from the pattern 
statement, the default value will work.

> On Nov 3, 2021, at 12:06 PM, Olumide <50...@web.de> wrote:
> 
> Dear List,
> 
> yanglint (version 0.16.105) does not validate the schema below when the
> a default value is assigned to string that has a pattern. Is this the
> specified behavior; and if so is there a workaround? (Comments not in
> schema, added for emphasis)
> 
>    module tmp
>    {
>        namespace "example.com";
>        prefix "foo";
> 
>        container bar {
>            leaf wibble {
>                type string {
>                    pattern "^x$";
>                }
>                default "x";      ### NOT OKAY
>            }
> 
>            leaf wobble {
>                type string;
>                default "y";     ### OKAY
>            }
>        }
>    }
> 
> 
> yanglint error message:
> 
> err : Value "x" does not satisfy the constraint "^x$" (range, length, or
> pattern). (/tmp:wibble)
> err : Module "tmp" parsing failed.
> 
> 
> Regards,
> 
> - Olumide
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

Mahesh Jethanandani
mjethanand...@gmail.com





_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to