You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a00d7b7
Browse filesBrowse the repository at this point in the historyBrowse files
fix(projection): a renamed key with a derived identity serves its item route in all five ports (#412)
* fix(projection): a renamed key with a derived identity serves its item route in all five ports
A view-only projection that passes the base key through on a renamed field and omits
@fields on its identity had no item route in TypeScript, did not compile in Kotlin and
answered 500 in C#. Each port now takes the key from the loader's own derivation.
Pinned by projection/keyed-by-derived-identity in the api-contract corpus.
* no-mistakes(document): docs(projection): clarify when to omit @fields on projection identities
├── keyless-no-item-route.yaml # no declared identity (even with an `id` field) → no /{id} route
70
76
├── keyed-by-non-id-field.yaml # key on `number`, view with no `id` column → that row, 404 envelope
77
+
├── keyed-by-derived-identity.yaml # key on `regNo`, identity omits `@fields` → the same contract
71
78
├── filter-decimal.yaml # FR-009 filter on a field.decimal
72
79
└── filter-float.yaml # FR-009 filter on a field.float
73
80
```
74
81
75
-
The three projections: `InvoiceSummary` (key passed through from `Invoice` on `id`),
76
-
`InvoiceLedger` (key on `number`; also the decimal and float fields) and `InvoiceStub` (no
77
-
identity). `docs-routes.json` is read by a per-port docs test, not by the scenario runners: it
78
-
lists, for each projection, the `GET` routes its api docs page documents (no write verb, and no
82
+
The four projections: `InvoiceSummary` (key passed through from `Invoice` on `id`),
83
+
`InvoiceLedger` (key on `number`, `@fields` explicit; also the decimal and float fields),
84
+
`InvoiceRegister` (key on `regNo`, `@fields` omitted) and `InvoiceStub` (no identity).
85
+
`docs-routes.json` is read by a per-port docs test, not by the scenario runners: it lists, for each projection, the `GET` routes its api docs page documents (no write verb, and no
79
86
`/{id}` for a keyless one), spelled without the api prefix and with `{id}`.
80
87
81
88
`seed.json` seeds the base `invoices` table. The views are created by each port's
@@ -101,11 +108,11 @@ nothing about the emitted artifact, which is the thing that was missing.
101
108
102
109
| Port | Generated lane | Note |
103
110
|---|---|---|
104
-
| TypeScript |**wired, green (11/11)**|`test/api-contract-projection.test.ts`|
105
-
| Python |**wired, green (11/11)**|`tests/integration/test_api_contract_projection.py`|
106
-
| C# |**wired, green (11/11)**|`MetaObjects.IntegrationTests/Api/ApiContractProjectionConformanceTest.cs`|
107
-
| Java |**wired, green (11/11)**|`integration-tests/.../ProjectionGeneratedApiContractConformanceTest.java`|
108
-
| Kotlin |**wired, green (11/11)**|`integration-tests-kotlin/.../ProjectionGeneratedApiContractConformanceTest.kt`|
111
+
| TypeScript |**wired, green (12/12)**|`test/api-contract-projection.test.ts`|
112
+
| Python |**wired, green (12/12)**|`tests/integration/test_api_contract_projection.py`|
113
+
| C# |**wired, green (12/12)**|`MetaObjects.IntegrationTests/Api/ApiContractProjectionConformanceTest.cs`|
114
+
| Java |**wired, green (12/12)**|`integration-tests/.../ProjectionGeneratedApiContractConformanceTest.java`|
115
+
| Kotlin |**wired, green (12/12)**|`integration-tests-kotlin/.../ProjectionGeneratedApiContractConformanceTest.kt`|
109
116
110
117
The docs half (`docs-routes.json`) runs in each port's unit-test project, over the same
0 commit comments