Software lab / Demonstration project

API Contract Lab.

Valid JSON is a format check. A valid request must also meet the application's rules. Edit the example to see the difference.

Use sample data. Validation happens in this browser; this tool does not submit or store your input.

Inspection result

Matches the example contract

  • All three required fields pass the example rules.
{
  "customerId": "demo-customer",
  "amountCents": 1250,
  "currency": "USD"
}

Read the tested case study and walkthrough

The example contract

What this demonstrates

A small validation function separates parsing, structure, and business constraints. Errors remain specific to the input, and values are not silently coerced into another type. The example includes tests for malformed input, wrong types, unexpected properties, and numeric boundaries.

View the source and run the tests on GitHub ↗

Practical limits

This is a demonstration created in September 2026 with AI-assisted implementation. It is not a client case study or a complete JSON Schema validator. It uses JSON.parse, so it does not independently detect duplicate keys or recover numerical precision lost during parsing. Input is limited to 131,072 UTF-16 code units. A passing result does not verify customer identity, authorization, pricing, or production readiness.

Read the design note ↗