Extract a string value from a regorus object.
(val: ®orus::Value, key: &str)
| 331 | |
| 332 | /// Extract a string value from a regorus object. |
| 333 | fn get_object_str(val: ®orus::Value, key: &str) -> Option<String> { |
| 334 | let key_val = regorus::Value::String(key.into()); |
| 335 | match val { |
| 336 | regorus::Value::Object(map) => match map.get(&key_val) { |
| 337 | Some(regorus::Value::String(s)) => { |
| 338 | let s = s.to_string(); |
| 339 | if s.is_empty() { None } else { Some(s) } |
| 340 | } |
| 341 | _ => None, |
| 342 | }, |
| 343 | _ => None, |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | fn endpoint_has_graphql_policy(val: ®orus::Value) -> bool { |
| 348 | has_non_empty_object_field(val, "graphql_persisted_queries") |
no test coverage detected