diff --git a/sonar/projects.py b/sonar/projects.py index e5c41255..8d62da9b 100644 --- a/sonar/projects.py +++ b/sonar/projects.py @@ -1038,10 +1038,8 @@ def export(self, export_settings: types.ConfigSettings, settings_list: Optional[ pass if contains_ai: json_data[_CONTAINS_AI_CODE] = contains_ai - for s in settings_dict.values(): - if not export_settings.get("INCLUDE_INHERITED", False) and s.inherited: - continue - json_data.update(s.to_json()) + with_inherited = export_settings.get("INCLUDE_INHERITED", False) + json_data["settings"] = [s.to_json() for s in settings_dict.values() if with_inherited or not s.inherited and s.key != "visibility"] except Exception as e: util.handle_error(e, f"exporting {str(self)}, export of this project interrupted", catch_all=True)