This repository provides examples of JSON Schemas used to generate forms dynamically. The examples are based on the JSON Schema standard and demonstrate various ways to structure and validate form data.
- You can simply fetch the directory contents using the GitHub API:
curl https://github.com/api/repos/pyck-ai/json-forms-examples/contents/
- Filter for the entries with the
type == dir
. - In there you can find the
dataSchema.json
anduiSchema.json
files for further processing. So just fetch them by replacingexample1
via:
curl https://github.com/raw/pyck-ai/json-forms-examples/refs/heads/main/example1/uiSchema.json
curl https://github.com/raw/pyck-ai/json-forms-examples/refs/heads/main/example1/dataSchema.json
- Use a JSON Schema-based form renderer (e.g., React JSON Schema Form or JSONForms) to visualize the forms.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Full Name",
"minLength": 2
},
"age": {
"type": "integer",
"title": "Age",
"minimum": 18
},
"email": {
"type": "string",
"format": "email",
"title": "Email Address"
}
},
"required": ["name", "age", "email"]
}
To render and test the example schemas, you can use:
This repository is licensed under the MIT License. See the LICENSE file for more details.