You have found an error in the spec, so your not actually misinterpreting something.
There is an updated version (from two days later) of the internet draft on the IETF website, where this example is different.
see: https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00#page-13
As the document is an internet draft, most likely the version on http://datatracker.ietf.org/ is the correct version.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF).
Additionally, the two versions have different dates, and expiry dates:
- version you link – written: January 30, 2013 and Expires: August 3, 2013.
- version on ietf – written on: February 1, 2013 and Expires: August 5, 2013
On the IETF version:
This schema will be used as an example:
{ "properties": { "p1": {} }, "patternProperties": { "p": {}, "[0-9]": {} }, "additionalProperties": false
This is the instance to validate:
{
“p1”: true,
“p2”: null,
“a32&o”: “foobar”,
“”: [],
“fiddle”: 42,
“apple”: “pie” }The three property sets are:
s [ "p1", "p2", "a32&o", "", "fiddle", "apple" ] p [ "p1" ] pp [ "p", "[0-9]" ]
Applying the two steps of the algorithm:
after the first step, "p1" is removed from "s"; after the second step, "p2" (matched by "p"), "a32&o" (matched by "[0-9]") and "apple" (matched by "p") are removed from "s".
The set “s” still contains two elements, “” and “fiddle”. Validation
therefore fails.