Skip to content

Commit

Permalink
Remove commented out code and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bryn committed Apr 22, 2024
1 parent 58f9b17 commit 4895316
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions apollo-router/src/plugins/telemetry/config_new/conditional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use std::sync::Arc;

use parking_lot::Mutex;
use schemars::gen::SchemaGenerator;
use schemars::schema::{Schema, SchemaObject, SubschemaValidation};
use schemars::schema::Schema;
use schemars::schema::SchemaObject;
use schemars::schema::SubschemaValidation;
use schemars::JsonSchema;
use serde::de::Error;
use serde::de::MapAccess;
Expand Down Expand Up @@ -59,6 +61,7 @@ where
}

fn json_schema(gen: &mut SchemaGenerator) -> Schema {
// Add the condition and also allow string as a fallback.
let mut selector = gen.subschema_for::<HashMap<String, T>>();
if let Schema::Object(schema) = &mut selector {
if let Some(object) = &mut schema.object {
Expand All @@ -74,25 +77,6 @@ where
})),
..Default::default()
})
// let mut selector = gen.subschema_for::<HashMap<String, T>>();
// if let Schema::Object(schema) = &mut selector {
//
// let subschema = SubschemaValidation {
// one_of: Some(vec![
// schema.object.take()
// ]),
// ..Default::default()
// };
// schema.subschemas = Some(Box::new(subschema));
//
// if let Some(object) = &mut schema.object {
// object
// .properties
// .insert("condition".to_string(), gen.subschema_for::<Condition<T>>());
// }
// }
//
// selector
}
}

Expand Down

0 comments on commit 4895316

Please sign in to comment.