File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ exports.validationMessagesFormatters = {
31
31
timestamp : ( ) => 'must be a valid ISO 8601 / RFC 3339 timestamp (example: 2018-07-06T12:34:56Z)' ,
32
32
date : ( ) => 'must be a valid ISO 8601 / RFC 3339 date (example: 2018-07-06)' ,
33
33
time : ( ) => 'must be a valid ISO 8601 / RFC 3339 time (example: 12:34:56)' ,
34
+ uri : ( ) => 'must be a valid URI' ,
34
35
hostname : ( ) => 'must be a valid hostname' ,
35
36
ipv4 : ( ) => 'must be a valid IPv4' ,
36
37
ipv6 : ( ) => 'must be a valid IPv6' ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export const validationMessagesFormatters = {
24
24
timestamp : ( ) => 'must be a valid ISO 8601 / RFC 3339 timestamp (example: 2018-07-06T12:34:56Z)' ,
25
25
date : ( ) => 'must be a valid ISO 8601 / RFC 3339 date (example: 2018-07-06)' ,
26
26
time : ( ) => 'must be a valid ISO 8601 / RFC 3339 time (example: 12:34:56)' ,
27
+ uri : ( ) => 'must be a valid URI' ,
27
28
hostname : ( ) => 'must be a valid hostname' ,
28
29
ipv4 : ( ) => 'must be a valid IPv4' ,
29
30
ipv6 : ( ) => 'must be a valid IPv6' ,
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export const validationMessagesFormatters: { [key: string]: ValidationFormatter
36
36
timestamp : ( ) => 'must be a valid ISO 8601 / RFC 3339 timestamp (example: 2018-07-06T12:34:56Z)' ,
37
37
date : ( ) => 'must be a valid ISO 8601 / RFC 3339 date (example: 2018-07-06)' ,
38
38
time : ( ) => 'must be a valid ISO 8601 / RFC 3339 time (example: 12:34:56)' ,
39
+ uri : ( ) => 'must be a valid URI' ,
39
40
hostname : ( ) => 'must be a valid hostname' ,
40
41
ipv4 : ( ) => 'must be a valid IPv4' ,
41
42
ipv6 : ( ) => 'must be a valid IPv6' ,
Original file line number Diff line number Diff line change @@ -263,6 +263,10 @@ t.test('Validation', (t: Test) => {
263
263
type : 'string' ,
264
264
format : 'date-time'
265
265
} ,
266
+ uri : {
267
+ type : 'string' ,
268
+ format : 'uri'
269
+ } ,
266
270
noMessage : {
267
271
type : 'string' ,
268
272
format : 'noMessage'
@@ -322,6 +326,7 @@ t.test('Validation', (t: Test) => {
322
326
date : 'whatever' ,
323
327
time : 'whatever' ,
324
328
dateTime : 'whatever' ,
329
+ uri : 'whatever' ,
325
330
noMessage : true ,
326
331
arrayPath : [ 'abc' ] ,
327
332
objectPath : {
@@ -363,6 +368,7 @@ t.test('Validation', (t: Test) => {
363
368
date : 'must be a valid ISO 8601 / RFC 3339 date (example: 2018-07-06)' ,
364
369
time : 'must be a valid ISO 8601 / RFC 3339 time (example: 12:34:56)' ,
365
370
dateTime : 'must be a valid ISO 8601 / RFC 3339 timestamp (example: 2018-07-06T12:34:56Z)' ,
371
+ uri : 'must be a valid URI' ,
366
372
noMessage : 'must match format "noMessage" (format)' ,
367
373
'needs-quotes' : 'must be a valid number' ,
368
374
uniqueItems : 'must NOT have duplicate items (items ## 0 and 1 are identical) (uniqueItems)'
You can’t perform that action at this time.
0 commit comments