Commit 318840d
fix(java): source+identity auto-name; emit byte-parity with TS canonical output
CanonicalJsonParser.processNode used to fall back to name = subType for
every node missing an authored name -- a Java convention TS does not share.
TS leaves name='' and the serializer omits the name key on emit. Java's
fallback spuriously emitted a name key on every nameless source.rdb and
identity.primary, breaking byte-parity with the shared conformance corpus
(e.g. source.rdb without an authored name emitted "name": "rdb"; identity
.primary without one emitted "name": "primary").
Targeted fix: the parser fallback now skips types in isAutoNamingType. We
add MetaSource.TYPE_SOURCE and MetaIdentity.TYPE_IDENTITY to that set
alongside the existing validator/view entries -- both go through
createOrOverlayMetaData's sequential auto-naming (rdb1, primary1, ...) and
the serializer's existing isAutoGeneratedName check then suppresses the
emitted name (matching the ^<subType>\d+$ pattern), preserving the TS
oracle byte form. Explicitly-named identity.secondary children (e.g. name:
"byEmail") continue to emit their authored name.
Also bundles a previously-uncommitted ConformanceTest improvement: the
canonical-serialization-mismatch failure now includes the expected/got
diff, not just a one-line label -- essential for diagnosing the next set
of remaining gaps.
Tests:
* Adds MetaSourceTest.sourceRdbWithoutNameRoundTripsByteIdentical -- a
focused round-trip smoke confirming the source.rdb body is emitted
as exactly {"@table": "..."} with no name key.
* Updates two existing lookups (MetaSourceTest, CanonicalJsonParserTest)
that asserted the old "subType-as-name" qualified form; they now look
up the auto-named form.
Un-gates 31 source-v2 stage-1 conformance fixtures (now pass on the Java
loader/serializer pipeline):
attr-default-polymorphic, auto-set-on-create, auto-set-on-create-and-update,
auto-set-on-update, enum-array, enum-inline, extends-multi-level,
extends-single-level, field-decimal-precision-scale,
field-object-storage-flattened, field-object-storage-flattened-nullable,
field-object-storage-jsonb-array, field-object-storage-jsonb-single,
field-string-maxlength, identity-primary-and-secondary,
identity-reference-simple, loader-basic-explicit-subtype,
loader-basic-multi-file-same-package, loader-basic-single-entity,
loader-filterable-on-indexed-no-warning, overlay-attr-last-writer-wins,
overlay-merge-flag-explicit, overlay-same-object-different-files,
relationship-one-to-many, source-db-table-default-schema-omitted,
source-db-table-explicit, source-db-table-with-schema,
source-db-view-with-schema, source-rdb-column,
source-rdb-referential-actions, subtype-entity-with-identity.
567/567 pass in metadata; full reactor BUILD SUCCESS across all 18 modules.
The remaining 41 ledger entries represent honest gaps in Java metatype
coverage (origin/layout/template/currency), validator implementations
(error-* expecting specific ERR_* codes Java does not emit yet),
warnings surface (no Java implementation), and the loader-root-name leak
(known H3a gap).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c0fc474 commit 318840d
6 files changed
Lines changed: 122 additions & 50 deletions
File tree
- server/java/metadata
- src
- main/java/com/metaobjects/loader/parser
- json
- test/java/com/metaobjects
- conformance
- loader/parser/json
- source
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
15 | | - | |
16 | | - | |
17 | 11 | | |
18 | 12 | | |
19 | 13 | | |
| |||
34 | 28 | | |
35 | 29 | | |
36 | 30 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 31 | | |
48 | 32 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 33 | | |
54 | 34 | | |
55 | 35 | | |
56 | 36 | | |
57 | 37 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 38 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 39 | | |
67 | | - | |
68 | 40 | | |
69 | | - | |
70 | | - | |
71 | 41 | | |
72 | | - | |
73 | 42 | | |
74 | 43 | | |
75 | 44 | | |
| |||
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
905 | 906 | | |
906 | 907 | | |
907 | 908 | | |
908 | | - | |
909 | | - | |
910 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
911 | 913 | | |
912 | 914 | | |
913 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
914 | 923 | | |
915 | 924 | | |
916 | 925 | | |
917 | 926 | | |
918 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
919 | 931 | | |
920 | 932 | | |
921 | 933 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
369 | 376 | | |
370 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| |||
server/java/metadata/src/test/java/com/metaobjects/loader/parser/json/CanonicalJsonParserTest.java
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
276 | | - | |
277 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| |||
Lines changed: 85 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
367 | 443 | | |
0 commit comments