Why do I get invalid JSON document as a response?

This is for version 7.7

This may have been fixed in later version, but when working with the API I often get an invalid JSON document as a response and I need to add characters to the response in order to successfully parse the JSON.

For example, if I make this API call, the JSON document is properly formatted and can be parsed with no problems:

https://my.sonarqube.server/api/settings/values?component=org.my.app:subsystem

{“settings”:[{“key”:“sonaranalyzer-cs.nuget.packageVersion”…

However if I make this API call, the JSON document is missing characters at the beginning of the response and is not able to be parsed unless I add them in myself. Specifically it’s missing the starting {" characters.

https://my.sonarqube.server/api/settings/values?component=org.my.app:subsystem&keys=sonar.branch.longLivedBranches.regex

settings":[{“key”:“sonar.branch.longLivedBranches.regex”…

thoughts?

Hi,

Sorry, but 7.7 is past EOL. The current LTS is 7.9.5 and the current version is 8.6. If you can reproduce this problem in either of those versions, we’d love to hear about it.

 
:woman_shrugging:
Ann