Skip to content

fix: add hazmat/export fields to ProductSchema source - #53

Open
azaczek wants to merge 1 commit into
commerce-operations-foundation:developfrom
azaczek:fix/product-json-hazmat-schema-drift
Open

azaczek wants to merge 1 commit into
commerce-operations-foundation:developfrom
azaczek:fix/product-json-hazmat-schema-drift

Conversation

@azaczek

@azaczek azaczek commented Jul 7, 2026

Copy link
Copy Markdown

Why

#25 added these fields directly to schemas/product.json by hand, but never updated the Zod source that generate-schemas.ts uses to produce that file. Running npm run generate:json-schemas on current develop silently deletes all 7 fields, since nothing in CI regenerates and diffs the committed schema against the Zod source. Verified this by running the generator before making any change — it removed the fields cleanly, no errors.

How

Added the same 7 fields to ProductCoreSchema (all z.string(), optional via the existing .partial()), then ran npm run generate:json-schemas. Resulting schemas/product.json has the same field names/descriptions/types as #25 intended, minus some malformed "value": {} artifacts from the original hand-edit (not a valid JSON Schema keyword, inert either way) and one typo fix ("Freigth" → "Freight").

Testing

  • npm run typecheck — clean
  • npm run lint — 0 errors (pre-existing warnings only, none in touched files)
  • npm test — 224/224 passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant