Skip to content

bardevil20/dynamic-form-schema

Repository files navigation

Dynamic Form Schema

Simple FastAPI app that creates forms from JSON schemas.

Setup

pip install -r requirements.txt
uvicorn main:app --reload

Visit http://localhost:8000

Usage

Send POST to /set-schema with JSON:

{
  "name": { "type": "string", "required": true },
  "email": { "type": "string", "email": true, "required": true },
  "age": { "type": "number", "min_value": 0, "max_value": 120 }
}

Then submit the form at /submit.

Schema Options

  • type: "string", "number", "date", "textarea"
  • required: true/false
  • min_length/max_length: for strings
  • min_value/max_value: for numbers
  • email: true for email validation
  • enum_values: array for dropdown options

Test

python test_schema.py

About

FastAPI app that creates forms from JSON schemas.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors