vector_config/external/
no_proxy.rs1use std::cell::RefCell;
2
3use serde_json::Value;
4
5use crate::{
6 schema::{generate_array_schema, SchemaGenerator, SchemaObject},
7 Configurable, GenerateError, Metadata, ToValue,
8};
9
10impl Configurable for no_proxy::NoProxy {
11 fn metadata() -> Metadata {
12 Metadata::with_transparent(true)
15 }
16
17 fn generate_schema(gen: &RefCell<SchemaGenerator>) -> Result<SchemaObject, GenerateError> {
18 generate_array_schema(&String::as_configurable_ref(), gen)
21 }
22}
23
24impl ToValue for no_proxy::NoProxy {
25 fn to_value(&self) -> Value {
26 serde_json::to_value(self).expect("Could not convert no-proxy list to JSON")
27 }
28}