3#include <userver/components/component_config.hpp>
4#include <userver/components/raw_component_base.hpp>
5#include <userver/yaml_config/impl/validate_static_config.hpp>
6#include <userver/yaml_config/schema.hpp>
12enum class ValidationMode {
20template <
typename Component>
21void TryValidateStaticConfig(
22 std::string_view component_name,
23 const components::ComponentConfig& static_config,
24 ValidationMode validation_condition
26 if (components::kHasValidate<Component> || validation_condition == ValidationMode::kAll) {
27 yaml_config::Schema schema = Component::GetStaticConfigSchema();
28 schema.path = component_name;
34template <
typename Component>
37 return Component::GetStaticConfigSchema();