-
Notifications
You must be signed in to change notification settings - Fork 308
fix(csharp): skip mock test examples with empty path parameters #14879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bf7b8da
7924f7e
3684313
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 convertLiteral blanket nop() return drops literal path parameter arguments, causing compilation errors
When
generateLiteralsis enabled,convertLiteralreturnsnop()unconditionally (line 145-146). This is correct for inline object properties (whereClass_literal filters out nop fields atLiteral.ts:115), but breaks path parameters that are passed as standalone method arguments. TheMethodInvocation.write()method (MethodInvocation.ts:95-106) does NOT filter out nop arguments — it just callsarg.write(writer)which writes nothing. This causes the literal path parameter value to be silently dropped from the method call.The generated snippet for the
literal/readonly-constantsfixture confirms this:await client.Path.SendAsync()is missing the requiredstring idargument (seePathClient.cs:83-86which requiresstring id). ThefallbackToDefaultparameter set atEndpointSnippetGenerator.ts:860is never reached because the early return on line 146 fires first.Affected code flow
getPathParameters(EndpointSnippetGenerator.ts:855-862) callsconvert()on each path paramliteral<"123">,convert()dispatches toconvertLiteral()convertLiteral()returnsnop()at line 146 before any value logicMethodInvocationrenders the nop as empty outputSendAsync()instead ofSendAsync("123")— CS7036 compilation errorPrompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.