test(docs): bind task validation errors to current validators

Merged
SI
2d ago
+237-1

When a developer follows the task reference, POST currently describes an integer error plus message, and PATCH requires missing_fields even for malformed JSON. Bind the corrected shared 400 documentation to the real POST/PATCH validators with synthetic malformed-JSON and wrong-type examples, pre-authentication/header checks, and a valid title-only PATCH control.

This companion changes the published fixture, regression test and contributor notes. It does not change API behavior. Marketing #223 authors the two corrected response definitions and examples; its source pin must follow the actual accepted API merge. Related: recoupable/mono#318 and recoupable/mono#360. The separate schedule-syntax implementation in #1100 is outside this change.

Validation: 225 contract tests; response-constructor type check; repository lint and scoped formatting pass. The full-project type check still reports exactly the same 211 inherited diagnostics; no new diagnostic was introduced. Tests use actual validators with mocked authentication and fenced networking; no stored task or hosted schedule is exercised.


Summary by cubic

Binds the published POST/PATCH task 400 error documentation to the real request validators. The docs previously described an integer error plus message, and PATCH required missing_fields even for malformed JSON; the corrected shared schema returns a string error and omits missing_fields for invalid JSON. No API behavior changes.

  • Adds publishedTaskValidation.test.ts comparing the published schemas and examples against the actual validators with malformed-JSON and wrong-schedule-type bodies, pre-auth and header checks, and a valid title-only PATCH control.
  • Updates the fixture and contributor notes; the Marketing source pin must follow the accepted API merge, and the separate schedule-syntax implementation in #1100 stays out of scope.
  • Runs 225 contract tests with no new type-check diagnostics.