fix(http-server-csharp): align controller argument order - #11903
Draft
sophia-ramsey wants to merge 1 commit into
Draft
fix(http-server-csharp): align controller argument order#11903sophia-ramsey wants to merge 1 commit into
sophia-ramsey wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <[email protected]>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses the ordering of controller call arguments in the generated C# code for the HTTP server emitter, ensuring that positional arguments match the order defined in the business interface. It introduces a mapping from canonicalized HTTP operations back to their original source operations, updates the controller and action rendering logic to use this mapping, and adds comprehensive tests to verify the new behavior.
Controller argument ordering and operation source mapping:
OperationSourcescontext and acanonicalOperationSourceMapin service resolution, which tracks the original source operation for each canonicalized HTTP operation. This mapping is provided throughout the emitter to ensure correct argument ordering. (packages/http-server-csharp/src/context/operation-source-context.ts [1] packages/http-server-csharp/src/service-resolution.ts [2]ControllerActionandControllercomponents to use the source operation fromOperationSourceswhen rendering method call arguments, ensuring correct positional mapping. (packages/http-server-csharp/src/components/controller-action/controller-action.tsx [1] [2] [3] [4] [5]; packages/http-server-csharp/src/components/controllers/controllers.tsx Ff671f60L9R9, [6] [7]Testing and validation:
Emitter integration:
OperationSourcescontext into the emitter so that all components have access to the canonical operation source mapping during code generation. (packages/http-server-csharp/src/emitter.tsx [1] [2]These changes together ensure that the generated C# controllers call business logic methods with arguments in the correct order, improving correctness and maintainability of the generated code.