Skip to content

Commit

Permalink
Fix uri schema validation
Browse files Browse the repository at this point in the history
foo,bar:baz is not a valid uri.

Refs: json-schema-org/JSON-Schema-Test-Suite#419
  • Loading branch information
ChALkeR committed Jul 22, 2020
1 parent 1946267 commit 255f945
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export const formats: {fast: DefinedFormats; full: DefinedFormats} = {
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
"date-time": /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,
"uri-reference": /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
"uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
"uri-template": URITEMPLATE,
url: URL,
// email (sources from jsen validator):
Expand Down

0 comments on commit 255f945

Please sign in to comment.