[azsdk-cli] Change boolean? to boolean for convert swagger/tsp tool#12050
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the type signature of the ConvertSwaggerAsync method by changing two parameters from nullable booleans (bool?) to non-nullable booleans (bool). This removes the need for null-coalescing operations when passing these parameters to downstream methods.
- Changes
isAzureResourceManagementparameter frombool?tobool - Changes
fullyCompatibleparameter frombool?tobool - Removes null-coalescing operators (
?? false) when passing parameters toRunTspClientAsync
4218c88 to
7d1b018
Compare
samvaity
left a comment
There was a problem hiding this comment.
Approved, with a minor note that the bool? specification isn't the main concern. For now, this serves as a good workaround until the copilot-intellij plugin addresses the actual issue.
@samvaity agreed, the bug report against the plugin is linked ^^ Though regardless I don't think we should really be using nullable parameter types anyways, so I'm happy to remove it permanently. |
Using the
boolean?nullable type results in a tools/list object that has an array type for thetypeproperty of the parameter (see below) instead of string. This breaks the IntelliJ copilot chat plugin when loading the MCP server tools (found by addingcom.github.copilot:traceto the intellij debug log configuration):The MCP schema appears to support any object type for the whole parameter property (https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.json#L2373-L2377), so my guess is this is an implementation issue with the plugin. Other mcp clients like vscode load the tools list just fine.
Below is an example of tool parameter properties returned from the
tools/listcall that reproduces the issue. Using"type": "boolean"works but"type": ["boolean","null"]will crash the plugin.As a follow-up I am going to add an analyzer to prevent nullable parameter types for MCP tools, unless we can confirm this is an issue with the copilot plugin or the MCP C# sdk and get it fixed upstream.