Skip to content

feat(swift): implement schema evolution compatible mode for fory swift#3363

Merged
chaokunyang merged 13 commits intoapache:mainfrom
chaokunyang:compatible_mode_fory_swift
Feb 19, 2026
Merged

feat(swift): implement schema evolution compatible mode for fory swift#3363
chaokunyang merged 13 commits intoapache:mainfrom
chaokunyang:compatible_mode_fory_swift

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented Feb 19, 2026

Why?

Swift xlang compatible mode was missing key schema-evolution behaviors used by cross-language tests, so several compatibility scenarios were not covered end-to-end.

What does this PR do?

  • Implements compatible-mode schema evolution in Fory Swift serialization/deserialization, including schema-hash-aware struct handling and field skipping for unknown/removed fields.
  • Adds dynamic type-info handling for heterogeneous arrays and maps in compatible mode.
  • Improves non-tracking reference canonicalization for collection/map elements when global reference tracking is enabled.
  • Extends Swift type/meta plumbing (Context, Serializer, TypeResolver, SchemaHash, ForyTypeId) and macro output to align with xlang compatible encoding requirements.
  • Reworks ForySwiftXlangPeer case handlers to round-trip major xlang scenarios through native Swift serializers (schema-consistent/compatible, polymorphism, nullable fields, refs/circular refs, unsigned).
  • Expands Java SwiftXlangTest with explicit @Test entries so Maven Surefire discovers inherited xlang cases consistently.
  • Updates a Swift unit test expectation to account for schema hash in the struct header.

Related issues

Closes #3362

#3349
#1017

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?

Benchmark

@chaokunyang chaokunyang force-pushed the compatible_mode_fory_swift branch from ce9ffb7 to 0a00cc6 Compare February 19, 2026 05:35
@chaokunyang chaokunyang merged commit 6545c87 into apache:main Feb 19, 2026
65 checks passed
@chaokunyang chaokunyang mentioned this pull request Feb 20, 2026
16 tasks
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.

[Swift] Support schema evolution for swift

2 participants