SerdeVal

A privacy-focused, blazingly fast data format validator supporting 14+ formats including JSON, YAML, XML, TOML, CSV, GraphQL, Markdown, and more.
Privacy-focused: All validation happens locally on your machine.
π Live Demo
freedatavalidator.xyz - Try it online (client-side validation)
π Features
- π Privacy-First: No logging, tracking, or data retention
- β‘ Blazingly Fast: Zero-dependency Go implementation
- π― Auto-Detection: Automatically detects data formats
- π± Multiple Interfaces: CLI, Go library, and web interface
- π Cross-Platform: Windows, macOS, and Linux support
- π§ Smart Formatting: Beautifies and validates in one step
- π Developer-Friendly: JSON output for CI/CD pipelines
| Format |
Extensions |
Auto-Detection |
Validation |
Use Case |
| JSON |
.json |
β
|
β
|
APIs, Config files |
| YAML |
.yaml, .yml |
β
|
β
|
Kubernetes, CI/CD |
| XML |
.xml |
β
|
β
|
Enterprise, SOAP |
| TOML |
.toml |
β
|
β
|
Config files |
| CSV |
.csv |
β
|
β
|
Data exchange |
| GraphQL |
.graphql, .gql |
β
|
β
|
API schemas |
| INI |
.ini, .cfg, .conf |
β
|
β
|
Config files |
| HCL |
.hcl, .tf, .tfvars |
β
|
β
|
Terraform |
| Protobuf |
.proto, .textproto |
β
|
β
|
Protocol Buffers |
| Markdown |
.md, .markdown |
β
|
β
|
Documentation |
| JSON Lines |
.jsonl, .ndjson |
β
|
β
|
Streaming data |
| Jupyter |
.ipynb |
β
|
β
|
Data science |
| Requirements.txt |
.txt |
β
|
β
|
Python deps |
| Dockerfile |
Dockerfile* |
β
|
β
|
Containers |
π¦ Installation
Using Go
# As a CLI tool
go install github.com/akhilesharora/serdeval/cmd/serdeval@latest
# As a library
go get github.com/akhilesharora/serdeval/pkg/validator
Pre-built Binaries
Download the latest binary for your platform from the releases page.
From Source
Linux/macOS
git clone https://github.com/akhilesharora/serdeval
cd serdeval
make build
Windows
git clone https://github.com/akhilesharora/serdeval
cd serdeval
go build -o serdeval.exe ./cmd/serdeval
Development Setup
For contributors, set up pre-commit hooks to ensure code quality:
# Install pre-commit hooks
make pre-commit
# Or manually
./scripts/setup-hooks.sh
This will install hooks that:
- Format code automatically
- Run tests before push
- Check for linting issues
- Prevent commits with formatting errors
Deployment
For server deployment, copy deploy.example.sh to deploy.sh and customize it with your specific configuration:
cp deploy.example.sh deploy.sh
# Edit deploy.sh with your server details
π₯οΈ Usage
Command Line Interface
# Validate a single file
serdeval validate config.json
# Validate multiple files
serdeval validate config.json data.yaml settings.toml
# Validate from stdin
echo '{"name": "John", "age": 30}' | serdeval validate
# Specify format explicitly
serdeval validate --format json config.txt
# Output as JSON for CI/CD pipelines
serdeval validate --json config.json
# Start web interface
serdeval web --port 8080
# Check version
serdeval version
# Windows examples
serdeval.exe validate config.json
type config.json | serdeval.exe validate
Go Library
package main
import (
"fmt"
"log"
"github.com/akhilesharora/serdeval/pkg/validator"
)
func main() {
// Auto-detect format
data := []byte(`{"name": "John", "age": 30}`)
result := validator.ValidateAuto(data)
if result.Valid {
fmt.Printf("Valid %s data\n", result.Format)
} else {
log.Fatalf("Invalid data: %s", result.Error)
}
// Validate specific format
v, _ := validator.NewValidator(validator.FormatJSON)
result = v.ValidateString(`{"test": true}`)
fmt.Printf("Valid: %v\n", result.Valid)
}
Web Interface
Start the built-in web server:
serdeval web --port 8080
Then visit http://localhost:8080 for a user-friendly interface with:
- Real-time validation as you type
- Auto-format with beautification
- Copy-to-clipboard functionality
- Format auto-detection
- 100% client-side processing (your data never leaves your browser)
π οΈ Development
Prerequisites
- Go 1.22 or higher
- Make (optional, for convenience commands)
Building
# Build for current platform
make build
# Build for all platforms
make build-all
# Run tests
make test
# Run linters
make lint
# Format code
make fmt
# Run benchmarks
make bench
Testing
# Run all tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
# Run benchmarks
go test -bench=. ./...
π€ Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Quick Start for Contributors
- Fork the repository
- Set up development environment:
make pre-commit
- Make your changes
- Run tests:
make test
- Submit a pull request
Please read our Code of Conduct.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Built with β€οΈ for the developer community
- Inspired by the need for privacy-focused validation tools
- Thanks to all contributors who help improve this project
Visit SerdeVal | Documentation | Report Issues