shijl0925 / python-sonarqube-api

Python Client library for interacting with Community, Developer, and Enterprise Editions SonarQube's REST APIs and SonarCloud's REST APIs.
https://python-sonarqube-pro-api.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
133 stars 76 forks source link

Calling sonar.alm_settings cause an project_key error #62

Closed SimonInOps closed 1 year ago

SimonInOps commented 1 year ago

After update to the latest version(1.3.2) getting an error when calling command: sonar.alm_settings.get_binding(project_key) Stack trace:

Traceback (most recent call last):
  File "main.py", line 19, in <module>
    alm = sonar.alm_settings.get_binding(project_key)
  File "~/.local/lib/python3.10/site-packages/sonarqube/utils/common.py", line 132, in inner_func
    response = self._get(url_pattern, params=params)
  File "~/.local/lib/python3.10/site-packages/sonarqube/utils/rest_client.py", line 141, in _get
    return self.request("GET", path=path, params=params, data=data, headers=headers)
  File "~/.local/lib/python3.10/site-packages/sonarqube/utils/rest_client.py", line 79, in request
    raise ValidationError(msg)
sonarqube.utils.exceptions.ValidationError: Error in request. Possibly validation error [400]: The 'project' parameter is missing

Downgrading package to 1.3.1 and running works as expected. Believe the problem is with added payload: sonarqube/utils/common.py

shijl0925 commented 1 year ago

I have remove the function of the 'add payload parameter'