Debian Codegraph @

ajv-formats/tests/extras/$data/format.json

raw symbols SCIP
1 [
2 {
3 "description": "one property has format set in another property",
4 "schema": {
5 "properties": {
6 "str": {
7 "format": {
8 "$data": "1/strFormat"
9 }
10 },
11 "strFormat": {}
12 }
13 },
14 "tests": [
15 {
16 "description": "a valid date-time string",
17 "data": {
18 "str": "1963-06-19T08:30:06.283185Z",
19 "strFormat": "date-time"
20 },
21 "valid": true
22 },
23 {
24 "description": "an invalid date-time string",
25 "data": {
26 "str": "06/19/1963 08:30:06 PST",
27 "strFormat": "date-time"
28 },
29 "valid": false
30 },
31 {
32 "description": "only RFC3339 not all of ISO 8601 are valid",
33 "data": {
34 "str": "2013-350T01:01:01",
35 "strFormat": "date-time"
36 },
37 "valid": false
38 },
39 {
40 "description": "a valid e-mail address",
41 "data": {
42 "str": "[email protected]",
43 "strFormat": "email"
44 },
45 "valid": true
46 },
47 {
48 "description": "an invalid e-mail address",
49 "data": {
50 "str": "2962",
51 "strFormat": "email"
52 },
53 "valid": false
54 },
55 {
56 "description": "valid if the format is undefined",
57 "data": {
58 "str": "any value"
59 },
60 "valid": true
61 },
62 {
63 "description": "fails if value of format is not a string",
64 "data": {
65 "str": "1963-06-19T08:30:06.283185Z",
66 "strFormat": 1963
67 },
68 "valid": false
69 }
70 ]
71 },
72 {
73 "description": "property name is the format for the property value",
74 "schema": {
75 "additionalProperties": {
76 "format": {
77 "$data": "0#"
78 }
79 }
80 },
81 "tests": [
82 {
83 "description": "valid formats",
84 "data": {
85 "date-time": "1963-06-19T08:30:06.283185Z",
86 "email": "[email protected]"
87 },
88 "valid": true
89 },
90 {
91 "description": "invalid date-time",
92 "data": {
93 "date-time": "06/19/1963 08:30:06 PST",
94 "email": "[email protected]"
95 },
96 "valid": false
97 },
98 {
99 "description": "invalid e-mail",
100 "data": {
101 "date-time": "1963-06-19T08:30:06.283185Z",
102 "email": "2962"
103 },
104 "valid": false
105 }
106 ]
107 }
108 ]