Skip to content

Proxies should honor MethodShapeAttribute.Name - #1271

Merged
Andrew Arnott (AArnott) merged 1 commit into
mainfrom
fix1267
Sep 5, 2025
Merged

Proxies should honor MethodShapeAttribute.Name#1271
Andrew Arnott (AArnott) merged 1 commit into
mainfrom
fix1267

Conversation

@AArnott

Copy link
Copy Markdown
Member

RPC targets already honored this attribute, so it's critical that proxies do as well, so that when proxies send requests, the servers will match them to a method.

Fixes#1267

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances JSON-RPC proxies to honor the MethodShapeAttribute.Name property, ensuring consistency between proxy clients and server targets that already supported this attribute. This prevents mismatches when proxies send requests to servers that use renamed methods via MethodShapeAttribute.

  • Adds support for MethodShapeAttribute.Name in proxy method name resolution
  • Updates metadata classes to track MethodShapeAttribute information
  • Adds comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
test/StreamJsonRpc.Tests/JsonRpcProxyGenerationTests.csAdds test method and interface definition to verify proxy honors MethodShapeAttribute
src/StreamJsonRpc/RpcTargetMetadata.csUpdates metadata handling to include MethodShapeAttribute in method name resolution
src/StreamJsonRpc/Reflection/RpcTargetInfo.csUpdates method registration to pass MethodShapeAttribute parameter
src/StreamJsonRpc.Analyzers/GeneratorModels/MethodModel.csAdds MethodShapeAttribute name resolution to proxy code generation
src/StreamJsonRpc.Analyzers/Types.csDefines constants for MethodShapeAttribute type information
src/StreamJsonRpc.Analyzers/KnownSymbols.csAdds MethodShapeAttribute to known symbols for compilation
src/StreamJsonRpc/netstandard2.1/PublicAPI.Unshipped.txtDocuments new public API for MethodShapeAttribute property
src/StreamJsonRpc/net8.0/PublicAPI.Unshipped.txtDocuments new public API for MethodShapeAttribute property
src/StreamJsonRpc/netstandard2.0/PublicAPI.Unshipped.txtNo changes (target framework doesn't support MethodShapeAttribute)

Comment threadsrc/StreamJsonRpc.Analyzers/GeneratorModels/MethodModel.cs
Sign up for freeto 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.

MethodShapeAttribute.Name should consistently be honored

3 participants

@AArnott@RyanToth3