@@ -364,7 +364,30 @@ var schemaExamples = []schemaExample{
364364 "56F5Bff4-Z4B6-48E6-a10D-B6CF66A83B04" ,
365365 },
366366 },
367-
367+ {
368+ Title : "STRING: format 'date'" ,
369+ Schema : NewDateSchema (),
370+ Serialization : map [string ]interface {}{
371+ "type" : "string" ,
372+ "format" : "date" ,
373+ },
374+ AllValid : []interface {}{
375+ "2017-12-31" ,
376+ "2017-01-01" ,
377+ },
378+ AllInvalid : []interface {}{
379+ nil ,
380+ 3.14 ,
381+ "2017-12-00" ,
382+ "2017-12-32" ,
383+ "2017-13-01" ,
384+ "2017-00-31" ,
385+ "99-09-09" ,
386+ "2017-01-00" ,
387+ "2017-01-32" ,
388+ "2017-01-40" ,
389+ },
390+ },
368391 {
369392 Title : "STRING: format 'date-time'" ,
370393 Schema : NewDateTimeSchema (),
@@ -379,6 +402,7 @@ var schemaExamples = []schemaExample{
379402 "2017-12-31T11:59:59+11:30" ,
380403 "2017-12-31T11:59:59.999+11:30" ,
381404 "2017-12-31T11:59:59.999Z" ,
405+ "2017-12-31T23:59:60" , // leap second
382406 },
383407 AllInvalid : []interface {}{
384408 nil ,
@@ -387,6 +411,12 @@ var schemaExamples = []schemaExample{
387411 "2017-12-31T11:59:59\n " ,
388412 "2017-12-31T11:59:59.+11:30" ,
389413 "2017-12-31T11:59:59.Z" ,
414+ "2017-12-00T11:59:59.Z" ,
415+ "2017-12-32T11:59:59.Z" ,
416+ "2017-12-40T11:59:59.Z" ,
417+ "2017-12-00T11:59:59" ,
418+ "2017-12-31T11:59:60" ,
419+ "99-09-09T11:59:59" ,
390420 },
391421 },
392422
0 commit comments