Day 039 / APIs / Test Data

Mock API Fixture Builder

View source ↗Scroll to explore ↓
Mock API Fixture Builder project cover
/ Overview

A dependency-free Python CLI that turns a bounded JSON blueprint into deterministic synthetic API fixtures in JSON array or JSON Lines format.

NameMock API Fixture Builder

ClientIndependent daily build

IndustriesDeveloper and API tooling

DateDay 039 · October 8, 2026

/ Challenge

Frontend work, demos and automated tests often need predictable API-shaped records. Copying production data creates privacy risk, while hand-editing fixtures is repetitive and can leave examples inconsistent between runs.

/ Provided services

Clear thinking.
Practical delivery.

01

Declarative fixture blueprints

Defines repeatable records through compact field rules instead of copying or manually editing production-shaped examples.

02

Strict input boundaries

Rejects unknown keys, unsupported rule types, invalid field names and oversized record or field counts.

03

Two practical formats

Writes an indented JSON array for review or one compact object per line for streaming-oriented tools.

Mock API Fixture Builder feature visual
/ Solution

Mock API Fixture Builder validates a small declarative JSON blueprint and creates deterministic synthetic records using integer sequences, numbered strings, alternating booleans, cycling enums and null fields. It enforces record, field and rule boundaries, outputs JSON or JSON Lines, and never connects to an API.

/ Impact

Deterministic synthetic records

Five focused field-rule types

One to 1,000 bounded records

One to 50 validated fields

JSON array and JSON Lines output

Twelve standard-library tests included

/ Tech stack

Python standard library

Argparse, pathlib, regular expressions and JSON provide the complete dependency-free command-line workflow.

Synthetic test data

Generates integer, string, boolean, enum and null values deterministically from a local blueprint.

Unittest

Twelve tests cover every rule, deterministic ordering, input limits, unknown configuration and CLI output.

Next project

Data Shape Profiler

View case study ↗