Skip to content

Commit 8e3d6e4

Browse files
committed
Add
1 parent 8132eb5 commit 8e3d6e4

File tree

2 files changed

+43
-92
lines changed

2 files changed

+43
-92
lines changed

README.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,34 @@ Edit the `example_schema.json` file to customize your form structure.
5353
## 🧪 Example Schema
5454
```json
5555
{
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"
6163
},
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
7482
}
83+
}
7584
}
7685
```
7786

example_schema.json

Lines changed: 17 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,31 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"title": "Employee Record",
3+
"title": "User Profile",
44
"type": "object",
5+
"required": ["name", "age", "email"],
56
"properties": {
67
"name": {
7-
"type": "string"
8-
},
9-
"employeeType": {
108
"type": "string",
11-
"enum": ["full-time", "part-time", "contractor"]
12-
},
13-
"salary": {
14-
"type": "number",
15-
"minimum": 0
9+
"title": "Full Name"
1610
},
17-
"hourlyRate": {
18-
"type": "number",
11+
"age": {
12+
"type": "integer",
13+
"title": "Age",
1914
"minimum": 0
2015
},
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": {
3317
"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"
5420
},
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"
6624
},
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
8729
}
8830
}
89-
}
31+
}

0 commit comments

Comments
 (0)