mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:29:40 +01:00
Import Bruno's YAML collections; fix defaults of on-by-default switches
- Bruno OpenCollection format (opencollection.yml, folder.yml, .yml requests, environments): folders and order, requests, bodies, auth including OAuth 2.0, settings, docs; scripts and other rules kept in Docs; a note when Bruno's hosted callback URI was used - bruno.json is optional for .bru collections; picking a folder that holds several collections names them - Collection variables that look like credentials (cookie, session, token, secret, password, api key) move to the secrets file and keep working under their name - KeyValue, CollectionSettings, MultipartPart, ExtractRule and AssertRule default to enabled like the file format; new collections no longer start with the cookie jar turned off
This commit is contained in:
@@ -691,10 +691,7 @@ pub fn import_source(app: AppHandle, state: State<'_, AppState>, source: String,
|
||||
let src = PathBuf::from(&source);
|
||||
let dest_path = PathBuf::from(&dest);
|
||||
let report = if src.is_dir() {
|
||||
if !src.join("bruno.json").exists() {
|
||||
return Err("this folder is not a Bruno collection (no bruno.json)".into());
|
||||
}
|
||||
importer::import_bruno(&src, &dest_path).map_err(errx)?
|
||||
importer::import_folder(&src, &dest_path).map_err(errx)?
|
||||
} else {
|
||||
let text = std::fs::read_to_string(&src).map_err(|e| format!("{source}: {e}"))?;
|
||||
import_text_into(&text, &dest_path)?
|
||||
|
||||
Reference in New Issue
Block a user