support relative URIs per RFC1808 and RFC3986
coderextreme opened this issue · 8 comments
Need to support leading . and .. for "format" : "uri"
or at least leading ..
@coderextreme Could you elaborate on your request? I don't see any use of relative paths in your examples. Is this in regards to remote $ref
s? They're not supported by this module
No, it's not remote refs, It's properties (@url, @*Url) marked as "format": "uri" in my schema. I need to validate URI's in my documents, and documents with a URI of .. don't pass. I have overridden the URI format for now. Thanks!
The following works fine for me:
var validate = require('is-my-json-valid')({type: 'string', format: 'uri'})
validate('http://hello.world/../hello.txt') // true
@emilbayes @coderextreme format "uri" was poorly specified in draft-04. Technially, it indicates a full URI (with scheme). The "uri-reference" format added in draft-06 is what would handle "../hello.txt"
as a URI reference to be resolved against the current base per RFC 3986
I'm going to close this. Well maybe not through the iPad app :(