File tree Expand file tree Collapse file tree 2 files changed +43
-92
lines changed Expand file tree Collapse file tree 2 files changed +43
-92
lines changed Original file line number Diff line number Diff line change @@ -53,25 +53,34 @@ Edit the `example_schema.json` file to customize your form structure.
53
53
## 🧪 Example Schema
54
54
``` json
55
55
{
56
- "type" : " object" ,
57
- "properties" : {
58
- "mode" : {
59
- "type" : " string" ,
60
- "enum" : [" simple" , " advanced" ]
56
+ "title" : " User Profile" ,
57
+ "type" : " object" ,
58
+ "required" : [" name" , " age" , " email" ],
59
+ "properties" : {
60
+ "name" : {
61
+ "type" : " string" ,
62
+ "title" : " Full Name"
61
63
},
62
- "settings" : {
63
- "if" : {
64
- "properties" : { "mode" : { "const" : " advanced" } }
65
- },
66
- "then" : {
67
- "properties" : { "threshold" : { "type" : " number" } }
68
- },
69
- "else" : {
70
- "properties" : { "notes" : { "type" : " string" } }
71
- },
72
- "type" : " object"
73
- }
64
+ "age" : {
65
+ "type" : " integer" ,
66
+ "title" : " Age" ,
67
+ "minimum" : 0
68
+ },
69
+ "email" : {
70
+ "type" : " string" ,
71
+ "format" : " email" ,
72
+ "title" : " Email Address"
73
+ },
74
+ "subscribe" : {
75
+ "type" : " boolean" ,
76
+ "title" : " Subscribe to Newsletter"
77
+ },
78
+ "bio" : {
79
+ "type" : " string" ,
80
+ "title" : " Short Bio" ,
81
+ "maxLength" : 250
74
82
}
83
+ }
75
84
}
76
85
```
77
86
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " http://json-schema.org/draft-07/schema#" ,
3
- "title" : " Employee Record " ,
3
+ "title" : " User Profile " ,
4
4
"type" : " object" ,
5
+ "required" : [" name" , " age" , " email" ],
5
6
"properties" : {
6
7
"name" : {
7
- "type" : " string"
8
- },
9
- "employeeType" : {
10
8
"type" : " string" ,
11
- "enum" : [" full-time" , " part-time" , " contractor" ]
12
- },
13
- "salary" : {
14
- "type" : " number" ,
15
- "minimum" : 0
9
+ "title" : " Full Name"
16
10
},
17
- "hourlyRate" : {
18
- "type" : " number" ,
11
+ "age" : {
12
+ "type" : " integer" ,
13
+ "title" : " Age" ,
19
14
"minimum" : 0
20
15
},
21
- "benefits" : {
22
- "type" : " object" ,
23
- "properties" : {
24
- "healthInsurance" : {
25
- "type" : " boolean"
26
- },
27
- "retirement401k" : {
28
- "type" : " boolean"
29
- }
30
- }
31
- },
32
- "contractEndDate" : {
16
+ "email" : {
33
17
"type" : " string" ,
34
- "format" : " date"
35
- },
36
- "department" : {
37
- "type" : " string"
38
- }
39
- },
40
- "required" : [" name" , " employeeType" ],
41
- "if" : {
42
- "properties" : {
43
- "employeeType" : {
44
- "const" : " full-time"
45
- }
46
- }
47
- },
48
- "then" : {
49
- "required" : [" salary" , " benefits" ],
50
- "properties" : {
51
- "salary" : {
52
- "minimum" : 30000
53
- }
18
+ "format" : " email" ,
19
+ "title" : " Email Address"
54
20
},
55
- "not" : {
56
- "required" : [" hourlyRate" , " contractEndDate" ]
57
- }
58
- },
59
- "else" : {
60
- "if" : {
61
- "properties" : {
62
- "employeeType" : {
63
- "const" : " part-time"
64
- }
65
- }
21
+ "subscribe" : {
22
+ "type" : " boolean" ,
23
+ "title" : " Subscribe to Newsletter"
66
24
},
67
- "then" : {
68
- "required" : [" hourlyRate" ],
69
- "not" : {
70
- "required" : [" salary" , " contractEndDate" ]
71
- }
72
- },
73
- "else" : {
74
- "if" : {
75
- "properties" : {
76
- "employeeType" : {
77
- "const" : " contractor"
78
- }
79
- }
80
- },
81
- "then" : {
82
- "required" : [" hourlyRate" , " contractEndDate" ],
83
- "not" : {
84
- "required" : [" salary" , " benefits" ]
85
- }
86
- }
25
+ "bio" : {
26
+ "type" : " string" ,
27
+ "title" : " Short Bio" ,
28
+ "maxLength" : 250
87
29
}
88
30
}
89
- }
31
+ }
You can’t perform that action at this time.
0 commit comments