use std::cell::RefCell;
use serde_json::Value;
use crate::{
schema::{generate_array_schema, SchemaGenerator, SchemaObject},
Configurable, GenerateError, Metadata, ToValue,
};
impl Configurable for no_proxy::NoProxy {
fn metadata() -> Metadata {
Metadata::with_transparent(true)
}
fn generate_schema(gen: &RefCell<SchemaGenerator>) -> Result<SchemaObject, GenerateError> {
generate_array_schema(&String::as_configurable_ref(), gen)
}
}
impl ToValue for no_proxy::NoProxy {
fn to_value(&self) -> Value {
serde_json::to_value(self).expect("Could not convert no-proxy list to JSON")
}
}