fix(http-server-csharp): resolve declared service namespace - #11908
Draft
sophia-ramsey wants to merge 2 commits into
Draft
fix(http-server-csharp): resolve declared service namespace#11908sophia-ramsey wants to merge 2 commits into
sophia-ramsey wants to merge 2 commits into
Conversation
Co-authored-by: GitHub Copilot <copilot@github.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 updates the logic for determining the generated C# service namespace in the
@typespec/http-server-csharppackage. Now, the namespace explicitly declared with@serviceis always used for the generated C# service namespace, even if an imported or unrelated namespace appears first. The changes also refactor and clarify related code, and add new tests to ensure correct behavior.Service namespace resolution improvements:
getServiceNamespaceinservice-discovery.tsto reliably select the namespace declared with@service, falling back to the first non-standard namespace with content if no service is declared.getServiceNamespaceNameto use the newgetServiceNamespacelogic, ensuring the correct namespace is used for C# code generation.resolveServiceTypesinservice-resolution.tsto usegetServiceNamespaceinstead of the previous custom logic, and updated documentation/comments for clarity. [1] [2]Testing and documentation:
service-resolution.test.tsto verify that the namespace declared with@serviceis used, and to cover fallback behavior when no service is declared. [1] [2]