mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
fix(engine): document importCsh path and data as alternative keys
The schema read `"path":str (.csh) | "data":str (base64)` as prose on path, so dispatch rejected `data` as unknown and the CSH import tests failed. Use `or`, the grammar for an alternative key. Signed-off-by: FredApps <[email protected]>
This commit is contained in:
1 parent
5a37b75771
commit
a546a2091e
2 files changed
+12
-1
No files matched your search
@@ -177,3 +177,14 @@ fn gradient_presets_stop_documents_the_set_keys() {
|
||||
assert!(schema.has_key("transparency"), "{}", spec.params);
|
||||
assert!(schema.has_key("opacity"), "{}", spec.params);
|
||||
}
|
||||
|
||||
/// `shape.presets.importCsh` documents `path` and `data` as alternative keys, so a base64
|
||||
/// `data` payload is accepted and not rejected as unknown (#15255).
|
||||
#[test]
|
||||
fn import_csh_documents_path_and_data() {
|
||||
let spec = crate::commands::find("shape.presets.importCsh").expect("registered");
|
||||
let schema = parse(spec.params);
|
||||
assert!(schema.has_key("path"), "{}", spec.params);
|
||||
assert!(schema.has_key("data"), "{}", spec.params);
|
||||
assert!(schema.has_key("group"), "{}", spec.params);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ pub(super) fn spec() -> CommandSpec {
|
||||
label: "Import Shapes",
|
||||
menu: &[],
|
||||
shortcut: None,
|
||||
params: r#"{"path":str (.csh) | "data":str (base64),"group":str?} → {group,count,names}; appends a uniquely named group, never replaces existing presets"#,
|
||||
params: r#"{"path":str (.csh) or "data":str (base64),"group":str?} → {group,count,names}; appends a uniquely named group, never replaces existing presets"#,
|
||||
enabled: always,
|
||||
run: import,
|
||||
journal: true,
|
||||
|
||||
Reference in new issue
Block a user