Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@
// volume: "memory",
// /// A complete storage advertises itself as containing all the known keys matching the configured key expression.
// /// If not configured, complete defaults to false.
// complete: "true",
// complete: true,
// },
// influx_demo: {
// key_expr: "demo/influxdb/**",
Expand Down
12 changes: 9 additions & 3 deletions plugins/zenoh-backend-traits/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,24 @@
)
}
};
let complete = match config.get("complete").and_then(|x| x.as_str()) {
Some(s) => match s {
let complete = match config.get("complete") {
Some(Value::Bool(b)) => *b,
Some(Value::String(s)) => match s.as_str() {

Check warning on line 448 in plugins/zenoh-backend-traits/src/config.rs

View check run for this annotation

Codecov / codecov/patch

plugins/zenoh-backend-traits/src/config.rs#L447-L448

Added lines #L447 - L448 were not covered by tests
"true" => true,
"false" => false,
e => {
bail!(
"complete='{}' is not a valid value. Accepted values: ['true', 'false']",
r#"complete='{}' is not a valid value. Only booleans or strings ('true','false') are accepted"#,

Check warning on line 453 in plugins/zenoh-backend-traits/src/config.rs

View check run for this annotation

Codecov / codecov/patch

plugins/zenoh-backend-traits/src/config.rs#L453

Added line #L453 was not covered by tests
e
)
}
},
None => false,
_ => bail!(
"Invalid type for field `complete` of storage `{}`. Only booleans or strings ('true','false') \
are accepted.",

Check warning on line 461 in plugins/zenoh-backend-traits/src/config.rs

View check run for this annotation

Codecov / codecov/patch

plugins/zenoh-backend-traits/src/config.rs#L459-L461

Added lines #L459 - L461 were not covered by tests
storage_name
),
};
let strip_prefix: Option<OwnedKeyExpr> = match config.get("strip_prefix") {
Some(Value::String(s)) => {
Expand Down
Loading