From b2bd1b10521689ed2a087b566d3ce2ec76416e73 Mon Sep 17 00:00:00 2001 From: gadhalekshmip <99868658+gadhalekshmip@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:11:18 +0530 Subject: [PATCH 1/4] Create readme.md --- data-passport-form/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 data-passport-form/readme.md diff --git a/data-passport-form/readme.md b/data-passport-form/readme.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/data-passport-form/readme.md @@ -0,0 +1 @@ + From 107809292106bc8ac7c9aa48b4718a67303427f9 Mon Sep 17 00:00:00 2001 From: gadhalekshmip <99868658+gadhalekshmip@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:13:51 +0530 Subject: [PATCH 2/4] Add files via upload --- data-passport-form/final.html | 442 ++++++++++++++++++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 data-passport-form/final.html diff --git a/data-passport-form/final.html b/data-passport-form/final.html new file mode 100644 index 0000000..be2bf5e --- /dev/null +++ b/data-passport-form/final.html @@ -0,0 +1,442 @@ + + + + + + JSON Schema Form Generator + + + +
+

JSON Schema Form Generator

+ +
+ + + Loading... +
+ +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ + + + From 61f1e24137df5159d2ae90917bbbc4d186137f93 Mon Sep 17 00:00:00 2001 From: Gadha Lekshmi P <99868658+gadhalekshmip@users.noreply.github.com> Date: Thu, 17 Apr 2025 13:43:28 +0530 Subject: [PATCH 3/4] Update readme.md --- data-passport-form/readme.md | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/data-passport-form/readme.md b/data-passport-form/readme.md index 8b13789..747ddb6 100644 --- a/data-passport-form/readme.md +++ b/data-passport-form/readme.md @@ -1 +1,42 @@ +# JSON Schema Form Generator + +A lightweight tool that generates web forms from JSON Schema definitions. This tool allows users to create, validate, and collect form submissions based on JSON Schema specifications. + +## 🚀 Features + +- Dynamically generates forms from JSON Schema +- Supports schema validation according to JSON Schema specification +- Handles nested objects and arrays +- Resolves JSON Schema references recursively +- Form submissions can be downloaded as JSON or CSV +- Converts GitHub URLs to raw GitHub URLs automatically +- Validation respects schema requirements (formats, patterns, etc.) + +## 🧩 Usage + +1. Enter a JSON Schema URL or paste a schema directly +2. Click **"Fetch Schema"** or **"Generate Form"** +3. Fill out the generated form +4. Submit the form to collect data +5. Download submissions as JSON or CSV + +## 🌐 Example URLs + +- Raw GitHub URL: + `https://raw.githubusercontent.com/OpenEthicsAI/OEDP/refs/heads/main/schema/oedp.passport.schema.json` + +## ⚠️ CORS Handling + +When working with external schema URLs, you may encounter **CORS (Cross-Origin Resource Sharing)** restrictions. To work around this: + +- Use **raw GitHub URLs** whenever possible (they bypass CORS issues) +- Copy and paste the schema directly into the text area + +## 🛠️ Local Development + +To run this tool locally: + +1. Clone the repository +2. Open the HTML file in a web browser + From 558e5c62a505b174c50afd4af9a09f138217c834 Mon Sep 17 00:00:00 2001 From: Gadha Lekshmi P <99868658+gadhalekshmip@users.noreply.github.com> Date: Thu, 17 Apr 2025 13:44:40 +0530 Subject: [PATCH 4/4] Update final.html --- data-passport-form/final.html | 742 ++++++++++++++++++++++++++++++---- 1 file changed, 667 insertions(+), 75 deletions(-) diff --git a/data-passport-form/final.html b/data-passport-form/final.html index be2bf5e..adbc5f5 100644 --- a/data-passport-form/final.html +++ b/data-passport-form/final.html @@ -56,6 +56,19 @@ border-left: 2px solid #ddd; } + .array-item { + margin-bottom: 10px; + padding: 10px; + border: 1px solid #ddd; + border-radius: 4px; + } + + .array-controls { + display: flex; + justify-content: flex-end; + margin-top: 5px; + } + .description { font-size: 0.9em; color: #666; @@ -74,6 +87,12 @@ margin: 10px 0; } + .validation-error { + color: red; + font-size: 0.9em; + margin-top: 5px; + } + .submit-btn { padding: 8px 16px; background-color: #007bff; @@ -105,6 +124,22 @@ border-radius: 4px; margin-bottom: 10px; } + + .helper-text { + background-color: #f8f9fa; + padding: 10px; + border-radius: 4px; + margin-bottom: 15px; + } + + .cors-warning { + background-color: #fff3cd; + border: 1px solid #ffeeba; + color: #856404; + padding: 10px; + border-radius: 4px; + margin-bottom: 15px; + } @@ -118,7 +153,18 @@

JSON Schema Form Generator

- +

Enter a JSON Schema URL or paste a schema below. Try these example URLs:

+ +
+ Note: Some URLs may be blocked by CORS policy. If you encounter CORS errors, you can: +
    +
  1. Use raw GitHub URLs (they work without CORS issues)
  2. +
  3. Copy the schema and paste it in the text area below
  4. +
  5. Use a CORS proxy by adding "https://cors-anywhere.herokuapp.com/" before your URL (requires requesting temporary access)
  6. +
+
@@ -144,24 +190,8 @@

Recent Submissions