Skip to content

feat(scala): add scala schema idl support#3681

Merged
chaokunyang merged 9 commits into
apache:mainfrom
chaokunyang:scala_xlang_schema_idl_support
May 15, 2026
Merged

feat(scala): add scala schema idl support#3681
chaokunyang merged 9 commits into
apache:mainfrom
chaokunyang:scala_xlang_schema_idl_support

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 14, 2026

Why?

Scala did not have schema IDL generation and xlang round-trip coverage alongside the other compiler targets. This PR adds the compiler, runtime, documentation, and CI coverage needed for Scala generated schemas to interoperate through Fory xlang.

What does this PR do?

  • Adds Scala as an FDL compiler target, including --scala_out, generator registration, Scala 3 code generation, nested type handling, unions, enums, field options, nullability, reference annotations, and package-option tests.
  • Extends Java compiler/runtime support needed by generated xlang serializers, including nested type resolution, union case annotations, static generated serializer registration/factory paths, resolver updates, and serializer/copy-context support.
  • Adds Scala runtime support for xlang serialization, including ForySerializer derivation macros, Scala enum handling, Scala collection serializers, and dispatcher registration.
  • Expands IDL and xlang coverage with Scala peer tests, nested-name schemas, Java/Scala round trips, Scala serializer tests, and a dedicated Scala xlang CI job.
  • Updates compiler and Scala/xlang documentation for Scala generation, generated code usage, nullability, reference tracking, and Scala type mappings.

Related issues

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?

Adds Scala compiler output options, Scala serializer derivation/registration APIs, and Java annotations/runtime hooks used by generated serializers. It documents Scala xlang mappings without changing existing binary protocol compatibility.

Benchmark

Not applicable.

@chaokunyang chaokunyang requested review from pandalee99 and urlyy May 15, 2026 01:01
@chaokunyang chaokunyang requested a review from LiangliangSui May 15, 2026 02:56
@chaokunyang chaokunyang merged commit 3d49c6f into apache:main May 15, 2026
60 checks passed
chaokunyang added a commit that referenced this pull request May 15, 2026
## Why?



## What does this PR do?



## Related issues

#3681 

## AI Contribution Checklist



- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
- [ ] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
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?

## Benchmark
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