Skip to content

Commit a71f94a

Browse files
committed
no-mistakes(document): Sync docs for 1.3.0 smoke-test fixes
1 parent d05a14a commit a71f94a

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎docs/features/api-contract.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ or Hono `onError` the adopter installed, answer exactly as they did before.
215215
| Response | When |
216216
|---|---|
217217
| malformed JSON body | a `POST`/`PATCH`/`PUT` body that does not parse as JSON (an empty body sent as `application/json` included) → HTTP 400 `{ "error": "invalid_json" }`. An EMPTY body on a method that takes none (`GET`, `DELETE`, `HEAD`) is accepted even when the request declares `content-type: application/json`, as many clients do on every request; a non-empty `DELETE` body is still parsed. Before, Fastify answered its own `{ "statusCode": 400, "code": "FST_ERR_CTP_INVALID_JSON_BODY", … }` and Hono a Zod `validation` error about a missing object |
218+
| malformed id | a `:id` the key column cannot hold (a malformed uuid on a Postgres uuid key, a non-numeric id on an integer key) → HTTP 400 `{ "error": "invalid_id" }` on GET, PATCH and DELETE. A malformed uuid in a POST or PATCH body's foreign key → HTTP 400 `{ "error": "validation" }`, from the insert/update schema's `8-4-4-4-12` hex check. Postgres used to answer 500 for both. The check is TS-only |
218219
| malformed page bound | a `?limit=` or `?offset=` that is not a non-negative integer (`abc`, `-5`, `1.5`, an empty value) → HTTP 400 `{ "error": "pagination.invalid_value", "param": "limit", "value": "abc", "expected": "a non-negative integer (0 or more)" }`. Before, a non-numeric bound was dropped (every row came back) and a negative or fractional one reached SQL. There is no page-size maximum on an entity or a projection with declared columns; an opaque view (no declared columns, served by raw SQL) pages to at most 1000 rows, so there a `limit` above 1000 is refused too, with `"expected": "an integer from 0 to 1000"` (it used to be clamped silently). The same answer comes from the Drizzle mounts and the ObjectManager Fastify mount. The corpus sends a malformed bound only to a report (`report/bad-page-bound`), where every port answers this same envelope and also refuses `limit=0`; on an entity or a projection the other ports answer it as their framework does |
219220
| database constraint violation | a write the database itself rejects → `{ "error": "constraint_violation", "constraint": "<kind>" }`, HTTP **409** for `unique` and `foreign_key` (a conflict with another row) and HTTP **400** for `check` and `not_null` (the request's own value), per the status rule under "Error response". The body names the constraint KIND only — never the SQL, the table or the bound values. A `CHECK` the model derives (an enum, a `validator.numeric`/`length`/`regex` range) is normally refused earlier by the route's own validation, as the corpus's `{ "error": "validation" }` 400; this row is the database's backstop |
220221
| schema validation failure | a body that fails the insert/update schema → HTTP 400 `{ "error": "validation", "issues": [...] }`, each issue as Zod reports it **minus `pattern`**: Zod 4 attaches a failed `.regex()` check's source there, which for a generated `field.date` / `field.time` / `field.timestamp` check is a ~300-character calendar regex (and an authored `validator.regex` pattern is the server's to keep). The generated temporal checks carry a short `message` naming the expected format instead (`"must be an ISO date (YYYY-MM-DD)"`) |

‎docs/features/cli.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,13 @@ the construct that replaces it:
583583
| Hand-rolled pattern | Suggested construct |
584584
|---|---|
585585
| an aggregate computed by hand (SQL `AVG`/`SUM`, a summing `.reduce(...)`) | For grouped, served or reported figures: `object.report` (dimensions + measures, read-only list route). For a per-row figure on one entity: `object.projection` with `origin.aggregate` and a generated query. |
586-
| money as a float / hand-rolled minor units (a money-named field with `* 100`, `/ 100`, `.toFixed(2)`, `parseFloat`) | `field.currency` |
586+
| money as a float / hand-rolled minor units (`* 100`, `/ 100`, `.toFixed(2)`, `parseFloat` on a money-named operand) | `field.currency` |
587587
| a fixed value set enforced by a SQL `CHECK (... IN (...))` | `field.enum` |
588588

589+
The scan skips comment lines. A `.reduce` counts only when it accumulates into its first
590+
parameter with `+`, and `.tsx`/`.jsx` UI files are not scanned for it, so on-screen totals
591+
are not flagged.
592+
589593
It is **warnings only** — it never changes the exit code (bias to under-flagging;
590594
a >15% false-positive rate is a project kill criterion). This pass is
591595
**Node-`meta`-specific**; the C#/Java/Kotlin/Python codegen surfaces do not run it.

‎docs/features/migrations-and-drift.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,12 @@ the case of an `@sql` body that joins it. `meta migrate` finds it by name in the
754754
stored definition, and recreates the view only when that definition also names the changed
755755
column. The same two costs apply.
756756

757+
A rename never rewrites a view body. When a migration renames a column and a view's `@sql`
758+
still names the old one, that view is recreated as declared and the migration fails at apply.
759+
`meta migrate` prints an advisory for it (`view <name> still names <table>.<column>, which this
760+
migration renames to <new>`), so the view, column and new name are all shown. The advisory does not block the plan. Change the view's `@sql` to the
761+
new name before you apply.
762+
757763
SQLite and D1 have no `CREATE OR REPLACE VIEW`: every replaced view is written as `DROP VIEW`
758764
and `CREATE VIEW` there, so there is no refusal to avoid and no probe. They refuse something
759765
else: a `DROP COLUMN`, or the rebuild of a table, while a view that reads the table stands. So

‎docs/features/migrations/upgrading-within-1.0.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ cross.
6767
served `object.report` that means: `entity`, `queries`, `names` and `barrel` write no report
6868
files; `routes` and `routes-hono` mount `GET /:id` and the item refusals on a report, and on
6969
SQLite send a ratio as a number; `hooks` writes no report hook, so a page that calls
70-
`use<Report>List` has nothing to import. `meta eject --list` shows which copies differ;
70+
the report's list hook has nothing to import. `meta eject --list` shows which copies differ;
7171
`meta eject <name> --force` takes the new reference, or three-way merge a copy you edited. An
7272
owned `mount-read-only.ts` under `codegen/runtime/` needs the same resync (`itemRoutes`,
7373
`resource` and `decimalColumns`). Only TypeScript has a generated client tier; the other

0 commit comments

Comments
 (0)