You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Improve the configuration schema
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
use clap::Parser;
|
||||
use mas_config::{ConfigurationSection, RootConfig};
|
||||
use schemars::schema_for;
|
||||
use schemars::gen::SchemaSettings;
|
||||
use tracing::info;
|
||||
|
||||
use super::RootCommand;
|
||||
@ -52,7 +52,12 @@ impl ConfigCommand {
|
||||
Ok(())
|
||||
}
|
||||
SC::Schema => {
|
||||
let schema = schema_for!(RootConfig);
|
||||
let settings = SchemaSettings::draft07().with(|s| {
|
||||
s.option_nullable = false;
|
||||
s.option_add_null_type = false;
|
||||
});
|
||||
let gen = settings.into_generator();
|
||||
let schema = gen.into_root_schema_for::<RootConfig>();
|
||||
|
||||
serde_yaml::to_writer(std::io::stdout(), &schema)?;
|
||||
|
||||
|
Reference in New Issue
Block a user