Closed Jeddumania closed 2 years ago
When using qualityprofiles.restore_quality_profile() method and providing proper xml file with backup, the method failes with message:
Error in request. Possibly validation error [400]: A backup file must be provided
Code snippet: with open('C:\\restore.xml', 'r') as f: sonar.qualityprofiles.restore_quality_profile(backup=f.read())
with open('C:\\restore.xml', 'r') as f: sonar.qualityprofiles.restore_quality_profile(backup=f.read())
restore.xml: <?xml version='1.0' encoding='UTF-8'?><profile><name>BackUp</name><language>java</language><rules/></profile>
<?xml version='1.0' encoding='UTF-8'?><profile><name>BackUp</name><language>java</language><rules/></profile>
I believe it is caused because backup file is passed as query parameter (so - /api/qualityprofiles/restore?backup=<?xml...) not as body:form-data parameter
/api/qualityprofiles/restore?backup=<?xml...
I fix this bug in version 1.2.7, please update it.
When using qualityprofiles.restore_quality_profile() method and providing proper xml file with backup, the method failes with message:
Code snippet:
with open('C:\\restore.xml', 'r') as f: sonar.qualityprofiles.restore_quality_profile(backup=f.read())
restore.xml:
<?xml version='1.0' encoding='UTF-8'?><profile><name>BackUp</name><language>java</language><rules/></profile>
I believe it is caused because backup file is passed as query parameter (so -
/api/qualityprofiles/restore?backup=<?xml...
) not as body:form-data parameter