jedison 0.3.22 → 0.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +45 -2
- package/dist/cjs/jedison.cjs +1 -1
- package/dist/cjs/jedison.cjs.map +1 -1
- package/dist/esm/jedison.js +86 -1
- package/dist/esm/jedison.js.map +1 -1
- package/dist/umd/jedison.umd.js +1 -1
- package/dist/umd/jedison.umd.js.map +1 -1
- package/package.json +12 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -12,22 +12,65 @@ Learn how to use Jedison with detailed guides and interactive examples.
|
|
|
12
12
|
|
|
13
13
|
## What is Jedison
|
|
14
14
|
|
|
15
|
+
Jedison generates forms from JSON schemas. Simply provide a JSON schema and Jedison automatically creates a complete, interactive form with built-in validation.
|
|
16
|
+
|
|
17
|
+
Here's a simple example:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"title": "Contact",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"name": {
|
|
25
|
+
"title": "Name",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1
|
|
28
|
+
},
|
|
29
|
+
"email": {
|
|
30
|
+
"title": "E-Mail",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "email",
|
|
33
|
+
"minLength": 3
|
|
34
|
+
},
|
|
35
|
+
"message": {
|
|
36
|
+
"title": "Message",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"minLength": 1,
|
|
39
|
+
"x-format": "textarea"
|
|
40
|
+
},
|
|
41
|
+
"gdpr": {
|
|
42
|
+
"title": "I have read and accept the privacy policy",
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"default": false,
|
|
45
|
+
"const": true,
|
|
46
|
+
"x-format": "checkbox"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This schema automatically generates a complete contact form:
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
15
56
|
Jedison helps you validate JSON data on the backend and generate interactive forms from JSON Schemas on the frontend.
|
|
16
57
|
|
|
58
|
+
**Backend Validation**: Jedison can also be used in headless mode for backend validation in Node.js environments. This is optional - you can use any other JSON schema validator you prefer for server-side validation.
|
|
59
|
+
|
|
17
60
|
One common workflow looks like this:
|
|
18
61
|
|
|
19
62
|
1. Your backend sends the JSON Schema to the client
|
|
20
63
|
2. Jedison automatically renders a complete form based on the schema
|
|
21
64
|
3. Users interact with the form while getting instant client-side validation
|
|
22
65
|
4. Validated data gets submitted back to your server
|
|
23
|
-
5. The same schema validates the data again server-side for security
|
|
66
|
+
5. The same schema validates the data again server-side for security (using Jedison in headless mode or any other validator)
|
|
24
67
|
|
|
25
68
|

|
|
26
69
|
|
|
27
70
|
But Jedison is flexible enough to support other patterns too - you might use it for:
|
|
28
71
|
|
|
29
72
|
- Standalone client-side forms without server validation
|
|
30
|
-
- Pure server-side JSON validation in your backend services
|
|
73
|
+
- Pure server-side JSON validation in your backend services (headless mode)
|
|
31
74
|
- Hybrid approaches where different parts of the schema are used in different contexts
|
|
32
75
|
|
|
33
76
|
## Install
|