uri-templates/uritemplate-test

Help understanding some negative tests

Closed this issue · 1 comments

Hi.

In negative-tests.json all result values (second member) are false and the readme says:

if the second member is boolean false, expansion is expected to fail (i.e., the template was invalid).

I don't understand why the following templates are considered invalid:

[ "{keys:1}",  false  ],
[ "{+keys:1}",  false  ],

As far as I can tell those templates are valid according to the spec:

expression      =  "{" [ operator ] variable-list "}"
variable-list   =  varspec *( "," varspec )
varspec         =  varname [ modifier-level4 ]
modifier-level4 =  prefix / explode
prefix          =  ":" max-length
max-length      =  %x31-39 0*3DIGIT   ; positive integer < 10000

I see that these two test cases have been around for a long time (since 2012), so there is obviously something going on that I don't fully understand. Could you please enlighten me?

Oh. I just realized that this has been discussed before and that there is an errata for it.