ā JSON Schema API Generator
A powerful Next.js application that automatically generates REST API endpoints from your JSON data and JSON Schema files. Upload your files, validate them with enhanced format checking, and instantly get production-ready API endpoints with interactive Swagger documentation.
ā šØāš» Developer
Thomas Rieger
š§ [email protected] ā
ā ⨠Features
ā š Automatic API Generation
Upload JSON data and JSON Schema files
Automatically generates RESTful API endpoints
Supports collection and individual item endpoints
No coding required - just upload and go!
ā š Enhanced Validation
Comprehensive JSON Schema validation using AJV
Advanced format validation support:
Email addresses
URIs and URLs
Dates (YYYY-MM-DD)
Date-time (ISO 8601)
Phone numbers
IPv4/IPv6 addresses
Hostnames
Custom formats (slugs, etc.)
Detailed error messages with field-specific feedback
Real-time validation results
ā š Interactive Documentation
Auto-generated Swagger/OpenAPI 3.0 documentation
Interactive API testing interface
Try endpoints directly from the documentation
Automatic schema generation from your data
Professional API documentation ready for production
ā š¾ Data Persistence
File-based data storage for reliability
Data persists between server restarts
Automatic data expiration (24 hours) for security
Graceful error handling and recovery
ā šØ Beautiful UI/UX
Modern, responsive design with Tailwind CSS
Drag-and-drop file upload interface
Real-time validation feedback
Copy-to-clipboard functionality for API endpoints
Gradient backgrounds and smooth animations
Mobile-friendly responsive design
ā š Quick Start
ā Prerequisites
ā Installation
Clone the repository
git clone <repository-url>
cd json-schema-api-generator
Copy
Install dependencies
Start the development server
Open your browser
Navigate to http://localhost:3000ā
ā š Usage Guide
ā Step 1: Prepare Your Files
You need two files:
JSON Data File : Contains your actual data
JSON Schema File : Defines the structure and validation rules
ā Download Sample Files
The application provides sample files to get you started:
Click "Download Sample Schema" for a complete schema example
Click "Download Sample JSON Data" for matching data
ā Step 2: Upload and Validate
Upload JSON Data : Drag and drop or click to select your JSON data file
Upload JSON Schema : Drag and drop or click to select your schema file
Click "Validate & Generate APIs" : The system will validate your data and create API endpoints
ā Step 3: Use Your APIs
After successful validation, you'll see:
ā
Validation success message
š List of generated API endpoints
š Link to interactive Swagger documentation
ā Generated Endpoints
For each array in your JSON data, you get:
Collection Endpoints:
Returns all items in the collection.
Individual Item Endpoints:
GET /api/{resource}/{id}
Copy
Returns a specific item by ID.
ā Step 4: Explore Documentation
Click "View Documentation" to access the interactive Swagger UI where you can:
Browse all available endpoints
Test APIs directly in the browser
View request/response schemas
Copy curl commands
Download OpenAPI specification
ā š Example Files
ā Sample JSON Data
{
"users": [
{
"id": 1,
"name": "John Doe",
"email": "[email protected] ",
"website": "https://johndoe.dev",
"birthDate": "1990-05-15",
"createdAt": "2024-01-15T10:30:00Z",
"phone": "+1234567890",
"isActive": true,
"role": "admin"
}
],
"products": [
{
"id": 101,
"name": "Wireless Headphones",
"price": 99.99,
"description": "High-quality wireless headphones",
"category": "Electronics",
"inStock": true,
"tags": ["audio", "wireless", "electronics"]
}
]
}
Copy
ā Sample JSON Schema
{
"type": "object",
"properties": {
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"website": { "type": "string", "format": "uri" },
"birthDate": { "type": "string", "format": "date" },
"createdAt": { "type": "string", "format": "date-time" },
"phone": { "type": "string", "format": "phone" },
"isActive": { "type": "boolean" },
"role": {
"type": "string",
"enum": ["admin", "user", "moderator"]
}
},
"required": ["id", "name", "email"],
"additionalProperties": false
}
}
},
"required": ["users"],
"additionalProperties": false
}
Copy
ā š§ API Reference
ā Validation Endpoint
Validates JSON data against schema and generates API endpoints.
ā Dynamic Resource Endpoints
GET /api/{resource} # Get all items
GET /api/{resource}/{id} # Get specific item
Copy
ā Documentation Endpoint
GET /api/swagger # Get OpenAPI specification
Copy
ā š ļø Technical Details
ā Built With
Next.js 13+ - React framework with App Router
TypeScript - Type-safe development
Tailwind CSS - Utility-first CSS framework
shadcn/ui - Beautiful UI components
AJV - JSON Schema validator with format support
Swagger UI React - Interactive API documentation
Lucide React - Beautiful icons
ā Architecture
File-based Storage : Persistent data storage using the file system
Server-side Validation : Secure validation on the backend
Dynamic API Generation : Runtime API endpoint creation
Responsive Design : Mobile-first approach
ā Data Storage
Data is stored in .data/store.json
Automatic cleanup after 24 hours
Graceful error handling and recovery
Git-ignored for security
ā š Security Features
Server-side validation only
No client-side data exposure
Automatic data expiration
Input sanitization and validation
No persistent database required
ā š Deployment
ā Vercel (Recommended)
npm run build
# Deploy to Vercel
Copy
ā Docker
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
Copy
ā Environment Variables
No environment variables required for basic functionality.
ā š¤ Contributing
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
ā š License
This project is licensed under the MIT License - see the LICENSEā file for details.
ā š Support
ā Common Issues
"No valid data available" Error
Ensure both JSON and Schema files are uploaded
Check that validation was successful
Try refreshing the page and re-uploading
Validation Errors
Check that your JSON data matches the schema structure
Verify format fields (email, date, etc.) are correctly formatted
Use the sample files as a reference
API Endpoints Not Working
Ensure validation was successful first
Check that your data contains arrays (collections)
Verify the endpoint URLs are correct
ā Getting Help
š§ Contact: Thomas Rieger at [email protected] ā
š¬ Create an issue on GitHub
š Review the documentation above
ā šÆ Roadmap
Support for POST/PUT/DELETE operations
Database integration options
Custom validation rules
API rate limiting
Authentication/Authorization
Export to Postman collections
GraphQL endpoint generation
Real-time API monitoring
Developed by Thomas Rieger | Made with ā¤ļø using Next.js and modern web technologies