Alternative · target: openapi-generator alternative

OpenAPI Generator Alternative for Warehouse inventory API Seed Data

User wants server stubs or client SDKs from a spec and is unhappy with the generated code volume.

Direct answer

SchemaSeed reads the Warehouse inventory API schema and writes loadable rows; OpenAPI Generator generates client and server code rather than test data. The gap appears with cross-table references.

That gap only matters once the fixture has two or more tables that reference each other, or once a test suite must assert the API rejects malformed input; for one flat schema OpenAPI Generator is usually sufficient.

The same Warehouse inventory API schema run through OpenAPI Generator yields a JSON document whose stock_items.warehouse_id reference values that match no parent row; the reference engine rejected that shape with "FOREIGN KEY constraint failed".

Data as of 2026-11-18 · source: 30 Stack Overflow questions, 1 Hacker News stories, @scalar/helpers at 48,499,279 monthly downloads · negative-case messages reproduced by executing the fixture against a local SQL engine (Node.js v24.22.0, engine 3.53.4) at 2026-11-18T11:53:54.233Z

What the incumbent does well — Warehouse inventory

OpenAPI Generator is a mature tool and it is not going away. For a single flat schema it produces valid JSON faster than anything else, and its API surface is small enough to learn in an afternoon. If your Warehouse inventory API fixture is one table with no cross-table references, the honest answer is that OpenAPI Generator is enough and this page will not change your mind.

The gap that matters for relational seeds

The gap appears the moment the fixture stops being one table. OpenAPI Generator reads one schema and produces one document; it has no second schema to read, so it cannot know that stock_items.warehouse_id must point at a row in warehouses. The result is values that are individually plausible and collectively unloadable. The reference engine rejected exactly that shape with "FOREIGN KEY constraint failed".

Side by side on the same fixture

The table below scores the two approaches against the identical Warehouse inventory API fixture. The rows are not opinions about architecture; each one is a property of the fixture that the reference engine can verify. The decisive row is the foreign key row, because a JSON document can carry a dangling reference without any tool complaining until the moment it is loaded.

Migrating an existing fixture

You do not have to rewrite your fixture. Keep the schema file, run the generator against it, and diff the output against the rows you already have. For Warehouse inventory API the diff is usually small: 2 tables, and the changes are the constrained columns, which are the ones a hand-written seed gets wrong most often. The negative case set is additive, so nothing you already depend on is lost.

How to decide in under a minute

Two questions decide it. Does your schema have more than one table that reference each other? Does your test suite need to prove the API rejects malformed input? If both answers are no, stay on OpenAPI Generator. If either is yes, the missing piece is the same in both cases: a generator that reads the whole document and treats the constraints as part of the contract rather than as decoration.

SchemaSeed vs OpenAPI Generator on the Warehouse inventory API fixtureEight criteria, each decided by a property of the fixture rather than by preference. The left column is what a schema-to-SQL generator does with it; the right column is what document generation leaves unresolved.
CriterionSchemaSeedOpenAPI GeneratorWhat decided it
Reads a multi-file OpenAPI documentyesyesboth resolve local $ref chains
Honours NOT NULLyespartialboth read the required array
Honours enum, range and length declarationsyespartialthe fixture declares stock_items.quantity with "quantity" >= 0; the declaration is read out of the schema, the DDL carries it as a CHECK constraint and the value that breaks it ships as a negative case
Honours enum membersyesyesthe enum array is copied verbatim
Produces SQL, not just JSONyesnooutput format is the difference
Resolves foreign keys across schemasyesnothe fixture has stock_items.warehouse_id pointing at warehouses, and the second tool never reads that table
Emits deliberately invalid instancesyesnonegative cases are a separate output
Same seed produces the same bytesyesnoboth are seedable
Real constraint failures for the Warehouse inventory API fixtureReproduced by executing the fixture against a local SQL engine (Node.js v24.22.0, engine 3.53.4) on 2026-11-18T11:53:54.233Z. The message column is verbatim engine output; the SQLSTATE column is the PostgreSQL error class for the same constraint class.
Failure classColumnSQLSTATEError nameEngine message (verbatim)
Missing required fieldwarehouses.code23502not_null_violationNOT NULL constraint failed: warehouses.code
Out-of-contract valuestock_items.quantity23514check_violationCHECK constraint failed: stock_items_quantity_check
Dangling foreign keystock_items.warehouse_id23503foreign_key_violationFOREIGN KEY constraint failed
The four checks that decide whether a schema tool is enough for Warehouse inventory APIApplied to Warehouse inventory API.
CheckResult on this fixtureConsequence
More than one table references anotheryes — stock_items → warehousesthe generator must resolve cross-table references
Output has to be SQL, not JSONyes — the target is PostgreSQLa document generator produces the wrong artefact
Tests must assert the API rejects bad inputyes — a negative case for every declaration in the schemanegative instances have to be generated separately
Same seed must reproduce the same bytesyes — seed 42 is fixedfixtures can be committed and diffed
seed.sql

npx --yes @wenlu8848/schemaseed generate --input ./alt_inventory.openapi.yaml --out ./seed --formats sql --count 10 --seed 42

Download alt_inventory.openapi.yaml

-- Generated by schemaseed.
-- seed: 42
-- rows per table: 10
-- Foreign key values are taken from the rows of the referenced table.

BEGIN;

CREATE TABLE IF NOT EXISTS "warehouses" (
  "id" UUID,
  "code" TEXT NOT NULL,
  "region" TEXT NOT NULL,
  CONSTRAINT "warehouses_pkey" PRIMARY KEY ("id")
);

CREATE TABLE IF NOT EXISTS "stock_items" (
  "id" UUID,
  "warehouse_id" UUID NOT NULL,
  "sku" TEXT NOT NULL,
  "quantity" INTEGER NOT NULL,
  CONSTRAINT "stock_items_pkey" PRIMARY KEY ("id"),
  CONSTRAINT "stock_items_quantity_check" CHECK ("quantity" >= 0)
);

DO $schema_seed$
BEGIN
  IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'stock_items_warehouse_id_fkey') THEN
    ALTER TABLE "stock_items" ADD CONSTRAINT "stock_items_warehouse_id_fkey" FOREIGN KEY ("warehouse_id") REFERENCES "warehouses" ("id");
  END IF;
END
$schema_seed$;


INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('e650b77e-6e8b-44f7-b3d7-5d4bf5ce0770', 'willow meadow', 'Bogota, Elm Avenue 23')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('2bc9638c-dfa0-4d86-b558-d6af4aa39325', 'gus.fontaine@test.dev', 'willow tundra')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('139ba9a0-aeb7-4b98-828e-2fc562b35fda', 'onyx bravo', 'onyx-fable-735')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('1a44dbad-a2e6-455d-b3ec-60f66fa99de6', 'rosa.bianchi@test.dev', 'river river')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('20a834dc-819d-4514-a070-bc6d70607fd3', 'Toronto, Maple Street 161', 'indigo-bravo-974')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('114bf3d7-c2fc-48ed-8a1c-83ff1e8854bc', 'Gus Jansen', 'Toronto, Oak Drive 64')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('8a70acf0-374f-4715-8e24-03755cbadca6', 'Lisbon, Elm Avenue 207', 'umbra-willow-971')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('a9d76991-ebcc-47f2-9e9e-76de89775a4d', 'Omar Okafor', 'lena.fontaine@mail.example')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('068f07da-e189-4caf-921d-4969758a34b8', 'tara.duarte@example.net', 'cedar indigo')
  ON CONFLICT DO NOTHING;
INSERT INTO "warehouses" ("id", "code", "region")
  VALUES ('8dfc21c4-9f43-4d6f-bbb9-1181ce0485bc', 'summit-vertex-353', 'indigo cedar')
  ON CONFLICT DO NOTHING;

INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('9e1172e2-1f6e-43bc-ab8a-d6c82a9d4722', '068f07da-e189-4caf-921d-4969758a34b8', 'onyx-kelp-373', 208)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('9c1f244c-81f4-4a5f-b977-de4cbaf49e9d', '20a834dc-819d-4514-a070-bc6d70607fd3', 'delta lumen', 88)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('aac8433f-2911-4c68-bbb1-21146ee6ffc5', '114bf3d7-c2fc-48ed-8a1c-83ff1e8854bc', 'willow grove', 12)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('0a403c0e-7e8f-4f90-ab33-e3a40f94f146', 'a9d76991-ebcc-47f2-9e9e-76de89775a4d', 'Toronto, Riverside Lane 4', 707)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('0614ba8f-8fbe-42d9-980a-3729b5c340a7', '20a834dc-819d-4514-a070-bc6d70607fd3', 'Bao Lund', 775)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('6cc21919-7260-4bd6-86cb-26ef151b9677', '139ba9a0-aeb7-4b98-828e-2fc562b35fda', 'milo.duarte@example.net', 220)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('dd5e46a4-1659-4eec-b856-f439a3820230', '20a834dc-819d-4514-a070-bc6d70607fd3', 'river grove', 341)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('dee95a59-55fa-4b34-a1f8-eb80c2eb5c76', '1a44dbad-a2e6-455d-b3ec-60f66fa99de6', 'quartz-tundra-390', 871)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('4db2ade6-ceda-4ae3-8202-686f4ceb456c', '20a834dc-819d-4514-a070-bc6d70607fd3', 'Berlin, Maple Street 86', 100)
  ON CONFLICT DO NOTHING;
INSERT INTO "stock_items" ("id", "warehouse_id", "sku", "quantity")
  VALUES ('4378efad-68be-4e8c-b186-52ce54840605', '114bf3d7-c2fc-48ed-8a1c-83ff1e8854bc', 'Quinn Jansen', 556)
  ON CONFLICT DO NOTHING;

COMMIT;

Frequently asked questions

Is OpenAPI Generator still worth using?
For one flat schema, yes. The gap opens on Warehouse inventory API: OpenAPI Generator produces values for a single schema, while this fixture has 2 related tables that have to load together.
Can I keep the fixtures I already wrote?
Yes. Regenerate against the same Warehouse inventory API schema and diff. On this fixture only the constrained columns move, and the negative cases are additive.
Does SchemaSeed replace OpenAPI Generator entirely?
No. It is a different artefact: OpenAPI Generator produces values for one schema, SchemaSeed produces a PostgreSQL seed script plus invalid instances for 2 related tables.
Is there a paid version?
No. The CLI is MIT licensed and free: unlimited local generation, no account, no telemetry and no usage limit, and it runs on your own machine. Sponsorship is what keeps it maintained.

Run it against your own schema

SchemaSeed is MIT licensed and free: unlimited local generation, no account, no telemetry and no usage limit. It reads your schema file on your own machine, so nothing is uploaded anywhere. If it saves you time, you can support the project.

Get SchemaSeed — free Support the project

Questions: support@schemaseed.drz8848.win