Commit 00c0316 1 parent dd3ca65 commit 00c0316 Copy full SHA for 00c0316
File tree 1 file changed +13
-2
lines changed
lib/vector-config/src/schema
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -479,12 +479,23 @@ pub fn generate_internal_tagged_variant_schema(
479
479
generate_struct_schema ( properties, required, None )
480
480
}
481
481
482
+ pub fn default_schema_settings ( ) -> SchemaSettings {
483
+ SchemaSettings :: new ( ) . with_visitor ( DisallowedUnevaluatedPropertiesVisitor :: from_settings)
484
+ }
485
+
482
486
pub fn generate_root_schema < T > ( ) -> Result < RootSchema , GenerateError >
483
487
where
484
488
T : Configurable + ' static ,
485
489
{
486
- let schema_settings =
487
- SchemaSettings :: new ( ) . with_visitor ( DisallowedUnevaluatedPropertiesVisitor :: from_settings) ;
490
+ generate_root_schema_with_settings :: < T > ( default_schema_settings ( ) )
491
+ }
492
+
493
+ pub fn generate_root_schema_with_settings < T > (
494
+ schema_settings : SchemaSettings ,
495
+ ) -> Result < RootSchema , GenerateError >
496
+ where
497
+ T : Configurable + ' static ,
498
+ {
488
499
let schema_gen = RefCell :: new ( schema_settings. into_generator ( ) ) ;
489
500
490
501
// Set env variable to enable generating all schemas, including platform-specific ones.
You can’t perform that action at this time.
0 commit comments