Skip to content

feat(csharp): add generated grpc support for C##3761

Merged
chaokunyang merged 6 commits into
mainfrom
add_csharp_grpc_support
Jun 13, 2026
Merged

feat(csharp): add generated grpc support for C##3761
chaokunyang merged 6 commits into
mainfrom
add_csharp_grpc_support

Conversation

@chaokunyang

@chaokunyang chaokunyang commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Why?

C# users can generate Fory model types today, but schemas that define services do not produce C# gRPC companions. This leaves C# out of the existing --grpc workflow used by the other supported service-generation targets.

What does this PR do?

  • Adds C# gRPC companion generation for Fory compiler services, including service descriptors, server base classes, clients, bind helpers, and Fory-backed request/response marshallers.
  • Extends C# generation ownership so schema modules are named from the source file stem and reused by service companions through the generated ThreadSafeFory module.
  • Adds C# preflight validation for generated output path and schema module owner collisions before writing files.
  • Updates compiler and service-codegen tests to cover C# gRPC output, streaming shapes, imported service types, identifier escaping, collision handling, and generated module naming.
  • Wires C# output into the cross-language gRPC generation helper.
  • Documents C# gRPC support, dependencies, generated API shape, troubleshooting, and compiler guide updates.

Related issues

#3266

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?
    • Adds generated C# gRPC companion APIs when foryc --csharp_out=... --grpc is used.
  • Does this PR introduce any binary protocol compatibility change?
    • The generated services use Fory-encoded gRPC message bodies, but this PR does not change the Fory binary protocol.

Benchmark

Not applicable.

@chaokunyang chaokunyang changed the title feat(csharp): add generated grpc support feat(csharp): add generated grpc support for C# Jun 13, 2026
@chaokunyang chaokunyang merged commit 3fe4048 into main Jun 13, 2026
49 checks passed
@chaokunyang chaokunyang deleted the add_csharp_grpc_support branch June 13, 2026 07:35
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