Skip to content

Treat blank optional string arguments as absent#413

Open
mysticfall wants to merge 2 commits into
SonarSource:masterfrom
mysticfall:master
Open

Treat blank optional string arguments as absent#413
mysticfall wants to merge 2 commits into
SonarSource:masterfrom
mysticfall:master

Conversation

@mysticfall
Copy link
Copy Markdown

Make getOptionalString return null for blank strings so that optional parameters with empty/whitespace-only values are treated the same as unset parameters.

This fixes an issue where invoking tools such as search_security_hotspots on a local project without a pull request ID fails, because the SonarQube Server's endpoint rejects a URL with an empty pullRequest parameter.

It's reproducible with OpenCode, using either a Docker or jar version of the project.

Part of

And please ensure your pull request adheres to the following guidelines:

  • Please explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make
  • Use the following formatting style: SonarSource/sonar-developer-toolset
  • Provide a unit test for any code you changed
  • If there is a JIRA ticket available, please make your commits and pull request start with the ticket ID (MCP-XXXX)

Make getOptionalString return null for blank strings so that
optional parameters with empty/whitespace-only values are
treated the same as unset parameters.
Sign up for free to 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.

1 participant