Newtonsoft.Json.Schema
Newtonsoft.Json.Schema copied to clipboard
Error when validating URI string
Hi,
For the below schema:
{ "title": "URL Form", "type": "object", "properties": { "url": { "title": "URL", "type": "string", "format": "uri" } } }
The following JSON does not validate:
{ "url": "https://www.lonza.com/Asset%20Download%20Manager.aspx?mediaid={9A99E464-CC08-45D9-AF14-115F0C6E086A}&mime=application/pdf&contentpage=1"}
Seemingly due to the curly braces. Apart from being a valid URL, and '{' not being an excluded character in the https://tools.ietf.org/html/rfc3986 standard.
Am I doing something wrong here?
You're not url encoding your query string values. Go do a google search for {9A99E464-CC08-45D9-AF14-115F0C6E086A} and see what the url looks like in your browser after searching. You will notice that the brackets are indeed encoded to %7B and %7D respectively.