Skip to content

pyck-ai/json-forms-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Forms Examples

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.

Getting Started

  1. You can simply fetch the directory contents using the GitHub API:
    curl https://github.com/api/repos/pyck-ai/json-forms-examples/contents/
  2. Filter for the entries with the type == dir.
  3. In there you can find the dataSchema.json and uiSchema.json files for further processing. So just fetch them by replacing example1 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
  1. Use a JSON Schema-based form renderer (e.g., React JSON Schema Form or JSONForms) to visualize the forms.

Example JSON Schema

{
  "$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"]
}

Running the Examples

To render and test the example schemas, you can use:

License

This repository is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published