Skip to content

Commit b5a3141

Browse files
committed
chore(changeset): word the inline mapping fix without rewrite framing
Claude-Session: https://claude.ai/code/session_01CxBKycaiUpA1yGx1XyoGqX Co-authored-by: Claude <noreply@anthropic.com>
1 parent db06ea3 commit b5a3141

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎.changeset/25491-import-inline-mapping-entry-rules.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
fix(rest)!: an inline import mapping entry's `transform`, `defaultValue` and `required` are applied, not dropped
66

7-
`POST /api/v1/data/:object/import` (and the async import job, which parses the same body) accepts `mapping` as a `FieldMappingEntry[]`, whose entries carry `transform`, `defaultValue` and `required`. The request parser kept only each entry's `sourceField` → `targetField` rename and dropped the rest, so a request asking for `transform: 'uppercase'` validated, ran, and stored the cell unchanged. Each entry's rules now run on its column before the cells are coerced:
7+
`POST /api/v1/data/:object/import` (and the async import job, which parses the same body) accepts `mapping` as a `FieldMappingEntry[]`, whose entries carry `transform`, `defaultValue` and `required`. The request parser kept only the column each entry names with `sourceField` and the field it names with `targetField` and dropped the rest, so a request asking for `transform: 'uppercase'` validated, ran, and stored the cell unchanged. Each entry's rules now run on its column before the cells are coerced:
88

99
- `trim`, `uppercase` and `lowercase` rewrite a string cell. `none` and `lookup` copy it; a `lookup` cell is resolved to a record id by the import's reference resolution, as before.
1010
- `defaultValue` fills a cell that is blank (absent, empty, whitespace or one of the request's `nullValues`).
1111
- `required: true` refuses the request with `400 MISSING_REQUIRED_FIELD` when a row still leaves that column blank, naming the column and the rows. The refusal comes before any row is written, on the dry run and the commit alike.
1212
- `transform: 'date_format'` refuses the request with `400 UNSUPPORTED_TRANSFORM`: an entry carries no date format for it to apply. A cell mapped to a date or datetime field is already parsed as a date, so drop the transform. A transform name outside the declared set is refused the same way.
1313

14-
A plain `{ sourceField, targetField }` entry, and the compact `{ column: field }` record, rename exactly as before.
14+
A plain `{ sourceField, targetField }` entry, and the compact `{ column: field }` record, map columns exactly as before.
1515

1616
Clause-②: no (narrowing) — the import doors refuse two request shapes they used to run: an inline mapping entry declaring `transform: 'date_format'` (or a transform name outside the declared set), and an entry marked `required: true` whose column a row leaves blank. Nothing is widened.
1717

0 commit comments

Comments
 (0)