Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace template preprocessing with re-mapping.
This change attempts to minimally address the awkwardness and shortcomings of the current URI template preprocessing approach. In addition to its dubious aesthetics, preprocessing does not help with using values other than the current instance or an immediate property (for an object instance) or element (for an array instance). Instead, use an object to map the variable names to locations in the instance with relative JSON pointers. This neatly solves both the UTF-8/illegal variable name problem and the complex data structure problem with the same mechanism. This is close to what is proposed in json-schema-org#52, but that proposal includes several other related features which are understandably more controversial. I think this is actually closer to the original proposal that preceded json-schema-org#52 in the old repo. The change from `vars` to `hrefVars` was inspired by the terminology being used in the JSON Home project. While compatibility with JSON Home is not a goal, I like how this clarifies exactly what the keyword is intended to do. Since `base` is also a template which was defined to use the same preprocessing as `href`, it likewise gets a corresponding `baseVars`.
- Loading branch information