Commit 33ad22e
authored
Drop always-id match_field from ListPathSegment runtime metadata (#1241)
## What
Removes the `match_field` attribute from `ListPathSegment` in the
runtime metadata, and switches the list-vs-object segment discriminator
in `SourcedFromNestedPathSegment.from_hash` from `match_field` to
`source_field`.
## Why
`match_field` was always `"id"` — ElasticGraph relationships join on
`id` via foreign keys, so the value carried no information. Serializing
a constant into runtime metadata adds noise without value, and keeping
it would have meant emitting `match_field: "id"` into
`runtime_metadata.yaml` once nested sourced paths are actually
populated.
This mirrors the equivalent cleanup already applied to the
schema-definition `PathSegment` in #1238. The match is now implicit:
list elements are matched on `id` against the value at `source_field`.
If non-`id` primary keys are supported in the future, the field can be
reintroduced then.
## Scope / risk
Low. `ListPathSegment` is not yet constructed by any production code —
only by the round-trip serialization unit test — so there is no
schema-artifact churn and nothing downstream consumes the removed field.
Specs and type checks pass.1 parent 6814370 commit 33ad22e
3 files changed
Lines changed: 10 additions & 11 deletions
File tree
- elasticgraph-schema_artifacts
- lib/elastic_graph/schema_artifacts/runtime_metadata
- sig/elastic_graph/schema_artifacts/runtime_metadata
- spec/unit/elastic_graph/schema_artifacts/runtime_metadata
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
0 commit comments