Err, actually I'm afraid a Link Description Object is not useful here - this is actually a question of validation.
The question, as I understand it, is how to validate against a smaller corner of a larger schema. For example, say you have this schema, at
http://example.com/mySchema:
{
"title": "User",
"type": "object",
"properties": {
"username": {
"title": "User name",
"type": "string",
"pattern": "[a-zA-Z][a-zA-Z0-9]*",
"maxLength": "20",
...
},
...
},
"required": ["username", "groups", "hobbies"]
}
Now, a user wants to change their username - however, they haven't completely re-submitted all the rest of the data (such as "groups" or "hobbies"), so the big schema is not useful. What we really want is to validate just against the schema for "username".
So basically, your only challenge is accessing the correct schema. If you already have the schema object loaded this is pretty simple - instead of having:
validate(submittedData, userSchema);
you can just use:
validate(submittedData.username, userSchema.properties.username);
Because the schema titled "User name" is a completely valid schema, you can use it just like any other schema.
If you aren't dealing with the schema object directly, but you are instead passing your validator a URL, like so:
It's worth noting that JSON Pointer fragments are not supported in all tools, and there is alternative syntax for version 3 of the draft.
I have to say, I haven't used JSV, so I don't know how it works in particular, but I hope that's helpful?
Geraint