Repository navigation
JSON mapping: codecs, creators, generics, arrays and null semantics - #6105
Conversation
…5995) Extends both the backend's build-time JSON codecs and the client's @mapped mappers with one shared set of annotations: - @JsonAdapter / JsonTypeAdapter: application codecs, called directly, no reflection; validated at build time. - @jsoncreator: immutable DTOs built through a constructor or factory. - Typed generic DTOs (Page<User> gets its own codec) and one-dimensional arrays; shapes that stay unsupported fail the build by name. - @JsonStrict (unknown members refused), @JsonProperty aliases/required, @JsonOmitNull, @jsonformat(STRING/NUMBER) for dates and numbers. - Path diagnostics ($.items[2].id: required member is missing) and a configurable depth limit (cn1.json.maxDepth). Default behaviour is unchanged: a class that uses none of the new options reads and writes as before, including an explicit null on the client. Docs gain a "Shaping the JSON contract" section and a Jackson migration table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
…ned adapter example Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s null Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flutter vs Codename OneSame application, built both ways: Flutter's AOT compile of the gallery, and the identical Dart source transpiled to Java on Codename One. Lower is better for every metric, so a ratio above 1.00x means Codename One is ahead by that factor. android9 interleaved rounds; host load 0.27, 1.47, 1.24
Compute -- the VM workloads (
Gate: within tolerance against
ios9 interleaved rounds; host load 31.42, 31.25, 24.74
Compute -- the VM workloads ( Not measured: iOS compute is not measured: a device build needs signed hardware, and on the simulator Flutter runs its JIT debug engine rather than AOT code. The macOS row runs the same ParparVM and Dart AOT compilers on the same Apple silicon. Gate: within tolerance against
javascript9 interleaved rounds; host load 2.07, 1.24, 0.53
Compute -- the VM workloads (
Gate: within tolerance against
linux9 interleaved rounds; host load 0.23, 2.88, 2.5
Compute -- the VM workloads (
Gate: within tolerance against
macos9 interleaved rounds; host load 3.92, 13.92, 16.98
Compute -- the VM workloads (
Gate: within tolerance against
windows9 interleaved rounds
Compute -- the VM workloads (
Gate: within tolerance against
Codename One wins 26 of 26 measured metrics across 6 platform(s). |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
|
Compared 191 screenshots: 191 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 227 screenshots: 227 matched. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 7763 64-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
Chain the parse cause, drop a redundant qualified name, end the number-sniffing loop without a branch, and reword an adverb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 192 screenshots: 192 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 188 screenshots: 188 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 189 screenshots: 189 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 184 screenshots: 184 matched. |
|
Compared 249 screenshots: 249 matched. |
Fixes #5995.
Both the backend's build-time JSON codecs (
BackendJsonCodecs) and the client's@Mappedmappers (MappingAnnotationProcessor) now read one shared set of annotations, so a class shared by an app and its backend has one JSON contract.New
@JsonAdapter+JsonTypeAdapter<T>: application codecs, called directly with no reflection, and validated at build time (public, concrete, no-arg constructor,Tmatching the field).@JsonCreator: immutable DTOs through a constructor or a static factory; records also work.Page<User>gets its own codec) and one-dimensional arrays. Shapes that stay unsupported (multi-dimensional arrays, bad adapters, folding codec names) fail the build with the field's name.@JsonStrictrefuses unknown members.@JsonPropertygainsaliasesandrequired.@JsonOmitNull;@JsonFormat(STRING/NUMBER)for dates (ISO-8601 UTC) and numbers.$.items[2].id: required member is missing. The depth limit is configurable throughcn1.json.maxDepth.Compatibility
nullclears a field only in@JsonStrictclasses, onrequiredmembers, and through adapters. Elsewhere it is read like an absent member, as the parser has always done.int[][]is refused.Docs:
Backend-Web.asciidocgains "Shaping the JSON contract" and a "Coming from Jackson" migration table, andAnnotation-JSON-XML-Mapping.asciidocis updated to match.Verification
build-enginesuite: 2884 tests, 0 failures. SpotBugs reports 0 findings onbuild-engine,backendandcore-unittests, and the cast-semantics check passes.🤖 Generated with Claude Code