Skip to content

feat(dart): support nested container field codec for dart#3641

Merged
chaokunyang merged 15 commits into
apache:mainfrom
chaokunyang:support_nested_container_field_for_go
May 1, 2026
Merged

feat(dart): support nested container field codec for dart#3641
chaokunyang merged 15 commits into
apache:mainfrom
chaokunyang:support_nested_container_field_for_go

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 1, 2026

Why?

Dart needs a canonical field type annotation surface that can describe nested container element/key/value semantics, including fixed-width and encoded numeric types, without relying on separate numeric wrapper annotations. The schema fingerprint calculation also needs to include nested container type IDs consistently across runtimes so compatible/schema-version checks agree for annotated nested containers.

What does this PR do?

  • Adds Dart nested container field type support through ForyField(type: ...), MapField, ListType, scalar type specs, and generated support for nested element/key/value metadata.
  • Updates the Dart compiler generator and generated test models to emit Dart int fields with explicit Fory type specs for fixed-width integer semantics, while keeping exact-width wrapper classes where the Dart runtime still requires them.
  • Removes obsolete Dart numeric wrapper exports/tests for small fixed-width integer wrappers and adds runtime validation utilities for integer bounds.
  • Extends Dart cross-language and unit coverage for nested annotated containers, integer round trips, type-spec annotations, signed/unsigned serializers, and xlang protocol behavior.
  • Aligns nested container schema fingerprint generation across Java, C++, C#, Go, JavaScript, Python, Rust, and Swift, and adds focused Swift/Java xlang coverage for Dart nested annotated containers.
  • Updates Dart guides, package README content, generated-code docs, and the xlang serialization spec to document the new annotation/type mapping model.

Related issues

#1017
#3630
#3625
#3630
#3636
#3639
#3640

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

This changes the Dart annotation/type-spec surface for fixed-width numeric and nested container field declarations. It updates schema fingerprint calculation to include nested container metadata consistently, but does not intentionally change the xlang binary protocol format.

Benchmark

@chaokunyang chaokunyang changed the title feat(dart): support nested container field for go feat(dart): support nested container field for dart May 1, 2026
@chaokunyang chaokunyang changed the title feat(dart): support nested container field for dart feat(dart): support nested container field codec for dart May 1, 2026
@chaokunyang chaokunyang merged commit c0b0839 into apache:main May 1, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants